Skip to content

Glossary: Algorithms Beyond the Basics in Go

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 total value that fits within a limit. Jo uses it to choose roast batches worth the most dollars in her minutes of roaster time.

Where the book teaches it

Related terms

Dynamic programmingSlice of slicesBottom-upCapacity and weights