Implemented SolutionWeightedQuickUnion.