2. Suppose we have a knapsack that can hold at most 7 pounds. The table below lists the weight and value of four items: item weight value 1 2 pounds $3.00 2 3 pounds $2.00 3 4 pounds $4.00 4 5 pounds $1.00 Use dynamic programming to solve the 0-1 knapsack problem and determine what items we should pack in the knapsack to achieve the maximum total value of packed items. Show your work (i.e., show the dynamic-programming table).

icon
Related questions
Question

Please help answer this question.

2. Suppose we have a knapsack that can hold at most 7 pounds.
The table below lists the weight and value of four items:
item
weight
value
1
2 pounds
$3.00
2
3 pounds
$2.00
3
4 pounds
$4.00
4
5 pounds
$1.00
Use dynamic programming to solve the 0-1 knapsack problem
and determine what items we should pack in the knapsack to
achieve the maximum total value of packed items. Show your
work (i.e., show the dynamic-programming table).
Transcribed Image Text:2. Suppose we have a knapsack that can hold at most 7 pounds. The table below lists the weight and value of four items: item weight value 1 2 pounds $3.00 2 3 pounds $2.00 3 4 pounds $4.00 4 5 pounds $1.00 Use dynamic programming to solve the 0-1 knapsack problem and determine what items we should pack in the knapsack to achieve the maximum total value of packed items. Show your work (i.e., show the dynamic-programming table).
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer