Greedy Algorithms: When They Work and When They Mislead
A greedy algorithm makes the choice that looks best at each step and is correct only when the greedy choice property holds: picking the meeting that ends first is optimal, picking the largest coin for 6 with {1, 3, 4} coins is not. We write activity selection, a min-heap room counter and Huffman coding in C#, explain the exchange argument, and hunt for counterexamples by comparing greedy with a referee.
8 Nov 2026
·
11 min
·
2