80 old_root=
find(old_root);
84 if(
find(new_root)!=old_root)
88 assert(new_root!=old_root);
91 nodes[new_root].parent=new_root;
94 nodes[old_root].parent=new_root;
95 nodes[old_root].count=0;
100 if(i!=new_root && i!=old_root && !
is_root(i))
103 if(r==old_root || r==new_root)
104 nodes[i].parent=new_root;
117 if(
find(i)==a && i!=a)
void resize(size_type size)
void make_union(size_type a, size_type b)
bool is_root(size_type a) const
size_type find(size_type a) const
size_type count(size_type a) const
void re_root(size_type old, size_type new_root)
void isolate(size_type a)
void check_index(size_type a)
void swap(unsigned_union_find &other)
std::vector< nodet > nodes
void intersection(const unsigned_union_find &other)
bool same_set(size_type a, size_type b) const
size_type get_other(size_type a)