Solved

Consider the Recursive Version of the Fib Method from the Textbook

Question 27

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 recursive calls to fib(2) will be made from the original call of fib(6) ?


A) 2
B) 3
C) 4
D) 5

Correct Answer:

verifed

Verified

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

Related Questions