Implementations for QuickFind, QuickUnion, WeightedQuickUnion and
WeightedQuickUnionWithPathCompression