Question: BackKnapsack: Implement the backtracking algorithm for Knapsack problem and modify the algorithm provided to output the max profit and the item numbers that give the

BackKnapsack: Implement the backtracking algorithm for Knapsack problem and modify the algorithm provided to output the max profit and the item numbers that give the solution. Code the below problem instance in your main method. Document the solution and provide correct code java with proven output plz

W=12

i j w
1 20 2
2 30 5
3 35 7
4 12 3
5 3 1

The link to the algorithm is on: The algorithm is also missing two parameters after bool promising so it should be bool promising(index i, int profit, int weight)

https://imgur.com/Hw56r8m

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!