Kruskal’s Algorithm
Initialize a UNION-FIND structure with each vertex v of V in a separate subset.
Consider each edge e of E in order of increasing weight.
For each edge (u, v), perform FIND(u) and FIND(v), and if they are in the same subset, go on to the next edge. Otherwise, add (u, v) to the spanning tree, and perform a UNION on the two subsets.
Keep a count of the number of edges added. When n-1 edges have been added (where n is the number of vertices), halt.