finished minimumSpanningTree (added DisjointSet taken from internet)