Algorithm Details:
(1) Sort edges in descending order by weight
(2) We process the sorted edges. For each edge, if the edge connects two different sets(components), we unite them (through a union operation) and add the edge to the spanning tree. We repeat this process until we have only one set(component).