Activity selection
easyFinishing early leaves the most room for what follows. Switch the criterion to earliest start or shortest duration and watch a provably optimal answer become merely a good one.
Worst
O(n log n)Space O(1)Loading the activity selection engine…