UnionFind
This is implement for below Java code to C++
http://algs4.cs.princeton.edu/15uf/