13 void init(
unsigned int n) {
15 for (
unsigned int i=0; i<n; ++i)
19 unsigned int find(
unsigned int i)
27 unsigned int tmp = at(i);
34 void unify(
unsigned int i,
unsigned int j)
void unify(unsigned int i, unsigned int j)
union of two groups
unsigned int find(unsigned int i)
find representative with path compression
union_find(unsigned int n)
construct with given number of elements
void init(unsigned int n)
init such that each element is a representative