Greedy Algorithm
overview
Summary
A greedy algorithm builds a solution step by step by always taking the locally best option available. It is fast and simple, often relying on sorting or priority queues to repeatedly pick the next best move. Greedy works when the problem has the greedy-choice property and optimal substructure, which you should justify with a proof or a clear argument. Classic wins include interval scheduling, minimum spanning trees, Huffman coding, and Dijkstra on nonnegative graphs.