Fibonacci 2: memoised recursion
Same recursion, but each answer is saved; a repeat call is a lookup instead of a subtree.
n5
fib(5) is not in the memo yet: recurse.
- fib(5): not in the memo: recurse
- compare
- swap or write
- settled
Space play · ← → step · Home End jump · drag the strip to scrub