Glossary: Coding Interviews in Go
Greedy
Also written: greedy algorithm
Taking the best-looking choice at each step. It only works for some problems: for 13 lb with bags of 2, 5 and 6, greedy fails but dynamic programming succeeds.
Glossary: Coding Interviews in Go
Also written: greedy algorithm
Taking the best-looking choice at each step. It only works for some problems: for 13 lb with bags of 2, 5 and 6, greedy fails but dynamic programming succeeds.