Glossary: Algorithms Beyond the Basics in Rust
Greedy algorithm
Also written: greedy
An algorithm that takes the best-looking choice at each step and never goes back. It is fast, but only correct when something like a swap argument shows the choice is safe.
Where the book teaches it
Related terms
Greedy choiceSwap argumentKruskal's algorithmInterval scheduling