Learn Dynamic Programming with Animated Tables
DP finally makes sense when you watch the table fill: knapsack take/skip decisions, LCS diagonals, and edit-distance minimums animated cell by cell.
Problem
Dynamic programming feels like magic formulas — dp[i][j] recurrences that work but never explain themselves, and interviews keep asking for them.
What to do
Every DP is just a table where each cell is computed from a few earlier cells. The Academy animates exactly that: when knapsack's dp[i][c] fills, the two cells it reads from light up — the skip above, the take up-and-left. After watching three tables fill, the recurrences stop being formulas and start being obvious. Start with Fibonacci, then LCS, then 0/1 knapsack; the coin-change demo even shows greedy failing where DP succeeds.
- 1Open Algorithm Academy and choose the Dynamic Programming topic.
- 2Start with Fibonacci to see memoization kill redundant work, then LCS with your own two strings.
- 3Step through slowly: for each highlighted cell, predict its value BEFORE reading it — the source cells are lit.
- 4Finish with 0/1 Knapsack and Coin Change, and note how every recurrence is a max/min over a handful of earlier cells.
Use the browser tool
Algorithm Academy is an interactive classroom for 30+ classic algorithms — searching, non-comparison sorting, dynamic programming, greedy strategies, backtracking, string matching, graph algorithms, and computational geometry. Every algorithm runs as a precomputed simulation you control: auto-play it, pause it, step forward and backward one operation at a time, or drag the scrubber to any moment. The pseudocode panel highlights the exact line being executed, every comparison shows a colored true/false verdict, and a plain-English narration explains each step — so you see not just WHAT the algorithm does, but WHY.
People also ask
- Can I step backward through an algorithm?
- Yes. Every simulation is precomputed into exact frames, so ◀ Prev and the scrubber move backward perfectly — nothing is re-run or approximated.
- Does the pseudocode really follow the execution?
- Yes. Each recorded step carries the pseudocode line that produced it, and that line is highlighted as the frame plays — the simulation lives inside the pseudocode.
- Can I use my own input data?
- Most algorithms accept custom input: arrays for searching/DP, text and pattern for string matching, sliders for N-Queens and Fibonacci, and a "New data" button regenerates graphs and point sets.

