Union-find API and quick-find algorithm.
Quick-union algorithm.