Algorithm implementation steps:
1. First arrange the weights from small to large
2. Starting from the edge with the smallest weight, find the two vertices of that edge
3. Build a binary tree. If a ring appears during the joining process, the edge of the weight is discarded until all vertices are found.