Use the tree-based union/find data structure from Chapter 10 along with one of the MST algorithms given in Chapter 12 and a good sorting algorithm.