Dynamic programming
Build answers from stored subproblems, then recover the choices behind an optimum.
Step forward, return to an earlier state, or scrub the timeline. Applying input begins a new run. Switching compatible algorithms retains the input; other algorithms load their own defaults.
Current state
Operation history
Pseudocode
Each highlighted line corresponds to an operation in the executable trace. Counts describe core algorithm work, excluding validation, snapshots, and rendering.
Read the executable JavaScriptExplore the lessons
- Fibonacci tabulation — Store smaller answers and build the next Fibonacci number.
- 0/1 knapsack — Build a table of best choices under a weight limit.
Follow the changing state
The data display shows each algorithm’s own variables and intermediate answers. Pink marks current work, amber marks dependencies or a divisor, and green marks a result. Each lesson explains its display, prerequisites, performance, and limitations.