Question: Suppose, you have to develop an algorithm for optimal arrangement of 5 objects (charger fan, laptop, sandwich maker, electric kettle, cell phone) in a carton
Suppose, you have to develop an algorithm for optimal arrangement of 5 objects (charger fan, laptop, sandwich maker, electric kettle, cell phone) in a carton which can carry a weight of maximum 20 kg. Weight and corresponding profit of these objects are respectively (12kg, $4), (2kg, $2), (4kg, $10), (1kg, $2), (1kg, $1). Now, find out those objects which gives you maximum profit and you can carry them in the carton using dynamic programming.
Step by Step Solution
3.43 Rating (159 Votes )
There are 3 Steps involved in it
This problem is generally known to the public as the 01 knapsack problemFirst think about the recursive approach of this algorithm and then we can sto... View full answer
Get step-by-step solutions from verified subject matter experts
