0
A naive recursive function fib(n) returns n if n ≤ 1 and otherwise returns fib(n−1) + fib(n−2). How many function calls (including the first one) are made when fib(5) is called?
- A11
- B15
- C13
- D25
Correct answer: B
A naive recursive function fib(n) returns n if n ≤ 1 and otherwise returns fib(n−1) + fib(n−2). How many function calls (including the first one) are made when fib(5) is called?