Question: Question 2 . Apply the bottom - up dynamic programming algorithm to the following instance of the 0 1 - knapsack problem, with capacity =

Question 2. Apply the bottom-up dynamic programming algorithm to the following instance of the 01-knapsack problem, with capacity =6 and five items with weights: 3,2,1,4,5 and values: 25,20,15,40,50.
\table[[item,weight,value],[1,3,25],[2,2,20],[3,1,15],[4,4,40],[5,5,50]]
F(i,j)=max{F(i-1,j),vi+F(i-1,j-wi)}ifj-wi0
=F(i-1,j){:ifj-wi0
F(0,j)=0 and F(i,0)=0
Question 2 . Apply the bottom - up dynamic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!