不相交集
我的不相交集(联合查找)数据结构的实现
用法
// divide collection on separate scopes
var unionFind = new DisjointSet ( nodes );
// check intersections between scopes of given objects
unionFind . Find ( Node1 , Node2 )
// union scopes
unionFind . Union ( Node1 , Node2