comparison between Prim's and Kruskal's algorithm