Question: You are given a bag that can carry a maximum weight of W. You are given N items, each of which has a weight

You are given a bag that can carry a maximum weight of 

You are given a bag that can carry a maximum weight of W. You are given N items, each of which has a weight of {W1, W2, W3, ..., Wn) and a value of {V1, V2, V3, ..., vn). Each item consists of two parts (each has half the weight and half the value). A) Use dynamic programming to write a pseudo-polynomial algorithm to choose what to carry in the bag in such a way that you get the maximum overall profit. B) Can you find the optimal solution for this problem using the greedy design technique? (yes or no), and briefly, justify your answer.

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 Computer Network Questions!