Solved

Consider the Recursive Version of the Fib Method from the Textbook

Question 40

Multiple Choice

Consider the recursive version of the fib method from the textbook shown below: public static long fib(int n)
{
If (n <= 2)
{
Return 1;
}
Else
{
Return fib(n - 1) + fib(n - 2) ;
}
}
How many total recursive calls (not counting the original call) to fib will be made from the original call of fib(6) ?


A) 6
B) 12
C) 14
D) 20

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions