AlgoScope

Base Case

AnalysisbeginnerDP Foundations

States whose values are known without recursion; they seed the table.

Decision · step 7 of 14DP on a Grid: Paths on a 3 x 4 grid
01230121✓11✓1✓12

(1, 1) can be entered from above, 1 way, or from the left, 1 way. Those are disjoint, so 1 + 1 = 2.

Open in the player →or start at step 7

What you will see

Seed cells are filled before any transition runs.

How dp on a grid works →

Cost

SpaceO(1)

How you work with it here

play it through, step one change at a time, scrub to any step, run it on your own input, predict what happens next.

Screen readers: Table cells announce their state and value; each step announces which cells were read and the value written.

Reduced motion: Dependency arrows appear statically and the cell value crossfades.

Before this

Leads to

Topics that need this one first.

Taught by the same lesson

DP on a Grid covers these too, in the same run.