Implementation of a UnionFind for random maze building.