Tracing a Recursive Method
Consider the following recursive method.
public static int baz(int k) {
if (k <= 1) {
return k;
} else {
return baz(k - 1) + baz(k - 2);
}
}
What is the value returned by the call baz(6)?
A
5
B
8
C
34
D
13
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE