Union Without The Find

int parent[N];

int find_set(int v) {
    if (v == parent[v]) return v;
    return parent[v] = find_set(parent[v]);
}

void union_sets(int a, int b) {
    parent[a] = b;          // line 9
}

Starting from make_set on 0..3, the calls union_sets(0, 1), union_sets(2, 3), union_sets(0, 2) run in that order. What does find_set(1) return afterwards, and what has gone wrong?

A

It returns 1, and the structure is still correct because element 1 was never an argument to the third call.

B

It returns 1. The third call overwrote parent[0], so element 1 is silently cut off from the component it was merged into.

C

It returns 3, because path compression repairs the missing find_set calls on the next traversal.

D

It loops forever, because line 9 can create a cycle in the parent array.