title: Union-find expressed as a social network
body: <p>This is an interview question that I am trying to answer:</p>
  
  <blockquote>
    <p>Given a social network containing <code>N</code> members and a log file containing <code>M</code> timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time at which all members are connected (i.e, every member is a friend of a friend of a friend...of a friend). Assume that the log file is sorted by timestamp and that friendship is an equivalence relation. The running time of your algorithm should be <code>M log N</code> or better and use extra space proportional to <code>N</code>.</p>
  </blockquote>
  
  <p>The first thing I thought was..."I can't do this!".</p>
  
  <p>But then I thought how can this social network be expressed as a data structure. Union-find is a data structure that can be used. Now I have to understand what it means when all members are connected. How can I view the actual data structure and what it looks like when every member became friends with each other?</p>
  
  <p>I think only until I can understand visually or conceptually how the system becomes fully connected can I begin to figure out how to find the timestamp that corresponds with that event.</p>