Mental Model
Recursion repeats work by solving the same subproblems many times. Dynamic programming saves answers to avoid repeating work.
Analogy: Imagine solving a big puzzle by breaking it into smaller pieces. If you forget which pieces you already solved, you waste time redoing them. Dynamic programming is like keeping solved pieces in a box to reuse.
Recursion tree with repeated nodes:
[5]
/ \
[4] [3]
/ \ / \
[3][2][2] [1]
/
[2]
Dynamic programming table:
Index: 1 2 3 4 5
Value: x x x x x
ā saves solved answers to reuse