Mental Model
We have three ways to solve problems: recursion tries all options, greedy picks the best now, and dynamic programming remembers past results to avoid repeats.
Analogy: Imagine climbing stairs: recursion tries every path, greedy picks the next step that looks easiest, and dynamic programming remembers which steps cost less to avoid redoing work.
Recursion tree:
root
/ \
/ \
left right
Greedy path:
start -> best next -> best next -> end
DP table:
index: 0 1 2 3
value: x y z w
memo: - - - -