-1

I want to apply the Knapsack algorithm at the following:
n = 4 (# of elements)
W = 5 (max weight)
Elements (weight, benefit):
(2,3), (3,4), (4,5), (5,6)
The first version of the algorithm is the following:
K(0)=0
for w=1 to W
K(w)=max_{w_i \leq w} {K(w-w_i)+v_i}
I have found the follo...