Added Kruskal's algorithm.