Implement Kruskal's algorithm, to build the minimum spanning tree for the points. Print out the length of the minimum spanning tree, followed by the edges used to construct the tree.

The input will consist of the # of vertices, the # of edges, and then a series of edges. As an example, we might have a 5 vertex graph, with 4 edges. I'll name the vertices A, B, C, D, E, for explanation, but they'll actually be numbered 0 through 4. A connects to B with a length of 10, B connects to C with length 3, A connects to D with length 5, A connects to E with length 2. The input file looks like this:

5 4
0 1 10
1 2 3
0 3 5
0 4 2

For this assignment, you won't need to use the abstract data structure from the connected components program; it can be much simpler. All you'll really need is an array of edges, and a disjoint set data structure.

Sort the edges based on cost, do the make-set for the vertices, and then run through edges in order. This should be an easy program.