Skip to content

Glossary: Algorithms Beyond the Basics in Go

Greedy algorithm

Also written: greedy

Takes the best-looking choice at each step and never undoes it. It is fast but only right when something, like a swap argument, shows the choice is safe.

Where the book teaches it

Related terms

Greedy choiceSwap argumentDynamic programming