cleanup 6 (typedef)
make UnionFind a class
add UnionFind::toGroups
rename this->union_find to this->parents