Recursive Method Return Value
Consider the following method.
public int computeDepth(int a, int b, int increment)
{
if (a == 0)
return b;
else
return b + computeDepth(a - 1, b, increment + 1);
}
What is returned by the call computeDepth(2, 5, 1)?
A
10
B
15
C
12
D
11
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE