Skip to content

Glossary: Algorithms Beyond the Basics in Java

0/1 knapsack

Also written: knapsack

A problem where each item (such as one of Jo's roast batches) is taken whole or not at all, and you want the most value that fits within a limit like 60 minutes. It is solved with a 2D table.

Where the book teaches it

Related terms

2D arraybottom-up (tabulation)greedy algorithm