5/40
Part 1 of 7 · Four thingsLearn and do

Top-down is the recurrence as a cached function, and the calls find an order by themselves

Why not write the recurrence as a recursive function? Plain recursion asks for the same cells again and again, the overlapping subproblems from the coin-change lesson. On random square grids of digits, one run each:

Predict

Plain recursion made 12,869 calls on an 8 by 8 grid. About how many on a 10 by 10?

Pick an answer above to see the rest
Predict

Swap the two calls in the max, so each call asks left first. In what order do the cells finish?

Pick an answer above to see the rest