finished Kruskal's minimum spanning tree and modified the find function so that it uses path compression (made adjustment in detectCycleUndirected2)