Solved

Consider the Fib Method from the Textbook Shown Below

Question 91

Multiple Choice

Consider 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) ;
}
}
Calling fib(3) will trigger ___ recursive call(s) and execute the terminating condition ___ time(s) , respectively.


A) 1, 1
B) 2, 2
C) 1, 2
D) 2, 1

Correct Answer:

verifed

Verified

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

Related Questions