What is the total number of recursive calls/invocations to compute fib(8)…
TPSC Computer/IT Posts 2026
What is the total number of recursive calls/invocations to compute fib(8) using the function ?
int fib(int n){
if (n == 1) return 1;
else if(n == 2) return 1;
else return(fib(n-1)+fib(n-2));
}- A.
13
- B.
21
- C.
30
- D.
41
Attempted by 360 students.
Sign up free to check your answer
Sign up freeLoading lesson…

