NOTE

Greedy Algorithms

Making locally optimal choices only when the problem structure proves they compose into a global optimum.

Data Structures & AlgorithmsCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

A greedy algorithm repeatedly makes the best-looking local choice and never revisits it.

Greedy is correct only when the problem has the required exchange/optimal-substructure property; intuition that a local choice “seems best” is not a proof.

Common examples include interval scheduling and Kruskal/Prim-style MST choices. When local decisions interact in ways that require considering alternatives, dynamic programming or search may be required.

Loading helpful count