Added kruskal's algorithm.