A UnionFind
data structure used to keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets.
abstract class AbstractUnionFind {
count: number;
constructor(...items?: any[]);
find(item: any);
connected(itemA: any, itemB: any): boolean;
union((itemA: any, itemB: any);
sets(): [][];
}