1 #include "unionfind.hh"
3 see a book on data structures
6 Union_find::Union_find(int n
)
10 for (int i
=0; i
< n
; i
++) {
16 Union_find::find(int i
)
19 while (classes
[rep
] != rep
)
21 while (classes
[i
] != rep
) {
30 Union_find::connect(int i
, int j
)