Kruskal's algorithm

welcome to shbcf.ru