Greedy
Take the locally best choice and never look back; correct only when an exchange argument holds.
Decision · step 2 of 4Greedy Choice: Coins where greedy fails
6 left. 4 fits, so take it once: 6 - 4 = 2.
What you will see
CANDIDATE -> LOCAL DECISION -> CONSEQUENCE; also a counterexample where greedy fails (coin change with 1, 3, 4).
Cost
| Space | O(1) |
|---|
How you work with it here
play it through, step one change at a time, compare two runs.
Screen readers: Each paradigm lesson is narrated as the characteristic loop it performs; the comparison view is available as a table.
Reduced motion: Side-by-side panes update in place.
Before this
Leads to
Topics that need this one first.