Implementing UnionFind.union (without weighting)