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.
Glossary: Coding Interviews in Rust
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.