UNPKG

442 BTypeScriptView Raw
1import { DisjointSetItem } from "./DisjointSetItem";
2export declare class DisjointSet<T = string> {
3 private key?;
4 private items;
5 private rootItems;
6 readonly RootItems: {
7 [index: string]: DisjointSetItem<T>;
8 };
9 constructor(key?: keyof T);
10 makeSet(value: T): this;
11 find(value: T): string;
12 union(value1: T, value2: T): this;
13 inSameSet(value1: T, value2: T): boolean;
14}
15export default DisjointSet;