Consider the following recursive definition of $fib$:
fib(n) := if n = 0 then 1 else if n = 1 then 1 else fib(n-1) + fib(n-2)
The number of times $fib$ is called (including the first call) for evaluation of $fib(7)$ is___________.
For those who are having difficulty visualising the 41 functions calls for fib(7), I have drawn the recursion tree.
64.3k questions
77.9k answers
243k comments
79.6k users