You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
271 B
11 lines
271 B
/**
|
|
* 并查集 Disjoint set to support quick union
|
|
*/
|
|
export default class UnionFind {
|
|
count: number;
|
|
parent: {};
|
|
constructor(items: (number | string)[]);
|
|
find(item: any): any;
|
|
union(a: any, b: any): void;
|
|
connected(a: any, b: any): boolean;
|
|
}
|
|
|