1
5
10
25
[0][1][2][3]
The greedy paradigm
▸1greedy(problem):2 solution ← empty3 while not done:4 choice ← best LOCAL option right now5 commit to choice // never reconsidered6 reduce problem by choice7 return solution8// valid only if greedy-choice property + optimal substructure
state
- coins[1, 5, 10, 25]