Question

5. Show the dynamic programming algorithm for the KNAPSACK problem as seenin the course (i.e., 0-1 KNAPSACK), for an instance with capacity c = 9 and thefollowing items:

Also show an optimal knapsack.

Fig: 1

Fig: 2

Fig: 3