Skip to content

Glossary: Algorithms Beyond the Basics in Java

swap argument

A way to prove a greedy choice is safe: take any best answer, swap its first choice for the greedy one, and show it gets no worse.

Where the book teaches it

Related terms

greedy algorithminterval scheduling