WeightedQuickUnion implemented