Glossary: Algorithms Beyond the Basics in Rust
Swap argument
A way to show a greedy choice is safe: take any best answer, swap its first choice for the greedy one, and show it gets no worse.
Glossary: Algorithms Beyond the Basics in Rust
A way to show a greedy choice is safe: take any best answer, swap its first choice for the greedy one, and show it gets no worse.