Builds a minimum spanning tree by sorting edges by weight and adding them if they don’t form a cycle.
Explain code with DocComment! Try out your own code!