Fie definițiile C/C++ de mai jos. Ce valoare va returna apelul J(0, 0, 0)?
const int N = 10;
const int V[N] = { 1, 1, 2, 2, 3,
1, 1, 1, 1, 3 };
int J(int x, int count, int i)
{
if (i == N) {
return x;
} else if (V[i] == x) {
return J(x, count + 1, i + 1);
} else if (count == 0) {
return J(V[i], 1, i + 1);
} else {
return J(x, count - 1, i + 1);
}
}