40 void join(
const size_t x,
const size_t y)
42 size_t x_root =
find(
x);
43 size_t y_root =
find(
y);
45 if (x_root == y_root) {
49 if (ranks[x_root] < ranks[y_root]) {
50 std::swap(x_root, y_root);
52 parents[y_root] = x_root;
54 if (ranks[x_root] == ranks[y_root]) {