Skip to content

Glossary: Coding Interviews in Rust

Greedy

Also written: greedy algorithm

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

Where the book teaches it

Related terms

Dynamic programming (DP)