Also, Prim's should be better as Kruskal would involving sorting the edges, which is not feasible when you millions of them. https://stackoverflow.com/questions/1195872/kruskal-vs-prim
64.3k questions
77.9k answers
244k comments
80.0k users