04 Try it yourself Interactive
The first tab draws every call plain recursion makes for climb(n), level by level. A box turns green when a base case answers outright, blue the first time a larger value is worked out, and rose whenever a value this run already settled is asked for again — every rose box drags a whole subtree behind it, and those subtrees are what a cache deletes. The second tab fills the table left to right, lighting the two cells each new value reads from. Nothing moves until you press Next.