Implemented kruskal A algorithm to find MST