let unionFind = new UnionFind(["a","b","c"]);
unionFind.addSubtree(
["d","e"],
[ ["a","b","c"],["d","e"]]
);
// => "a","b","c" is a subtree, "d","e" is a subtree
let unionFind = new UnionFind(["a","b","c"],[["a","b"]]);
unionFind.union("b","c");// => "b" is the parent of "c"
example
Compression Union
let unionFind = new UnionFind(["a","b","c","d"],[["a","b","c"]],{unionMode:unionMode.compress});
unionFind.union("c","d");// => "a" is the parent of "d"
UnionFind