UnionFind is a data structure to manipulate disjoint-set. Complexity of operations is O(α(n)) (inverse Ackermann function) amortized