Implementation for MST using Kruskal's Algorithm with disjoint sets.