Question: Question 3 ( 2 0 marks ) There are n items and a knapsack. Each item i has weight w i > 0 and has
Question marks
There are items and a "knapsack". Each item i has weight and has value Knapsack has capacity of The goal is to fill knapsack so as to maximize total value. Please adopt dynamic programming to handle the following instance of the knapsack problem. For example, weight capacity Item has weight kg and has value $ Item has weight kg and has value $ Item has weight kg and has value $ Item has weight kg and has value $
a Show the recursion property and your idea. Hint: use to represent the optimal solution of items subset dots, with capacity marks
b Fill in the table and show how to get the optimal solution, ie The empty table is shown as follows. marks
Page of
CONFIDENTIAL
CSTA
table
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
