c++; add UnionFind implemented with Disjoint-set forest