Skip to content

Glossary: Coding Interviews in JavaScript

Greedy

Also written: greedy algorithm, greedy algorithms

Taking the best-looking choice at each step. It works for only some problems, and fails for 13 lb with bags of 2, 5 and 6.

Where the book teaches it

Related terms

Dynamic programming (DP)