UnionFind 4 algorithms of union find, quick find, quick union, weighted quick union and weighted quick union with path compression. Reference https://en.wikipedia.org/wiki/Disjoint-set_data_structure https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf