Skip to content

Glossary: Algorithms Beyond the Basics in Rust

0/1 knapsack

Also written: knapsack, knapsack problem

A problem where each item is taken whole or not at all, and you want the most value that fits within a limit. Jo picks roast batches worth the most dollars that fit in her remaining roaster minutes.

Where the book teaches it

Related terms

Dynamic programmingVector of vectorsBottom-up (tabulation)