Open webartifex opened 3 years ago
Simply exit early if i == 0
Note that runtime of fib(20)
is 39 steps in cached recursive version vs 19 in the iterative version!
Use inspect
module to indent debug output for fibonacci()
(cf., Programming Interview Problems, p. 8)
Check corner cases for iterative fibonacci() function in Chapter 4