Mental Model
Recursion solves problems by breaking them into smaller parts, but it repeats work when parts overlap. Dynamic Programming saves these results to avoid repeating work.
Analogy: Imagine solving a big puzzle by solving smaller pieces. If you solve the same piece many times, it wastes effort. Dynamic Programming is like remembering solved pieces so you don't redo them.
Recursion tree with repeated nodes:
[5]
/ \
[4] [3]
/ \ / \
[3] [2] [2] [1]
↑ repeated nodes
Dynamic Programming table:
Index: 0 1 2 3 4 5
Value: - - - - - -
Filled as solved, no repeats