title: How to use union-find, minheap, Kruskal's, and a sort algorithm to create a minimum cost spanning tree? (C++)
body: <p>I apologize if this question is a bit broad, but I'm having a difficult time trying to understand how I would create a minimum cost spanning tree. This is in C++ if it matters at all.</p>
  
  <p>From what I understand, you would use Kruskal's to select the minimum cost edges for building the spanning tree. My thinking is to read the edges into a minheap and that way you can remove from the top in order to get the edge with the minimum cost.</p>
  
  <p>So far I've only been able to implement the minheap and sets for union-find, I am still unsure of the purpose of union-find and a sorting algorithm for the purpose of creating a spanning tree.</p>
  
  <p>I would greatly appreciate any advice. </p>
  
  <p>EDIT: I am not limited to union find, minheap, kruskals, and a sorting algorith, nor am I required to do any. These were just the items suggested by the instructor.</p>