Quick union UnionFind implementation