Knapsack Problem

Each item contains a weight and a value. A knapsack contains a finite capacity.

  • Goal: maximize the values in the knapsack while not overloading the capacity.

  • O/1 means we can either put items in the knapsack, or we do cannot. No splitting of items is allowed.

Base Conditions

  • 0 weight = 0 items (cannot fit anything).

  • 0 items = 0 knapsack items.

Last updated

Was this helpful?