Greedy algorithm
Strategy: make the locally best choice at every step and hope the result is globally optimal. Not always — but often enough to apply.
Works when the problem has the greedy choice property (local optimum leads to global) + optimal substructure. Classic examples: Dijkstra (greedy + DP), Kruskal's MST, Prim's MST, Huffman coding, activity selection.
When it works: fast (O(n log n) typical), easy to implement. Trap: problems that look greedy but aren't (knapsack, partition). Competitor: DP (when greedy fails), backtracking.