Add QuickUnion C++ implementation