Knapsack problem is also called as rucksack problem.
It is a problem in combinatorial optimization.
Knapsack problem states that: Given a set of items, each with a mass and a value, determine the number of each item to include in a collection so that the total weight is less than …