04 Try it yourself Interactive
Two modes, one press at a time. Activity selection walks whatever events you load in finish order and accepts or rejects each one — green bars are taken, rose bars are gone for good. Coin change runs the same amount twice: greedy first, then the answer dynamic programming finds, so you can compare the two counts. On some coin sets a gap opens up; on others greedy happens to tie, and the line under the controls tells you which.