Question: In Java use recursion write a program that solves the Knapsack problem. Code to the following standards. Your source of items to put into the
In Java use recursion write a program that solves the Knapsack problem. Code to the following standards.
Your source of items to put into the knapsack should consist of five randomly generated integers in the range of 1 to 20.
Your knapsack can hold 20 lbs.
Knapsack code traditionally ends when you find a total weight of items that equals the capacity of the knapsack. In this case, it is possible that you will never reach the knapsack capacity. It is also possible that the a single item will be big enough to fill the backpack. Make sure your code ends gracefully if that occurs.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
