Question: Given n items, choose a subset to put into the knapsack such that the capacity of the knapsack is not exceeded and the total value

Given n items, choose a subset to put into the knapsack
such that the capacity of the knapsack is not exceeded
and the total value of the selected items is maximized
Example
Suppose that Josie Camper is going on an overnight hike.
There are four items Josie is considering taking along on the
trip. The weight of each item and the benefit Josie feels she
would obtain from each item are listed in table.
Suppose Josie's knapsack can hold up to 14 pounds of items.
Which items should Josie put into his knapsack so that he
maximizes his benefit?
 Given n items, choose a subset to put into the knapsack

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 Databases Questions!