Call count of memoized Fibonacci
You compute with top-down recursion plus a memo cache, counting every invocation of the fib function - including calls that return immediately from the cache and the base cases , . The initial call fib(10) counts as one. How many total calls occur? (Convention: , .)
Show hints (2)+
- Each of the recursing values makes exactly two child calls.
- Total calls .
Answer
Reveal answer →Final answer
19
Create a free account to see the full worked solution and track your progress.
Interview format: Market Maker, Options Trading