Homework 5
l Optimal substructure:
n Given an optimal subset A of items, if remove item
j, remaining subset A = A-{j} is optimal solution
to knapsack problem (S = S-{j}, W = W - wj)
l Key insight is figuring out a formula for c[i,w],
value of soln for items 1..i and max weight w:
n Time: O(nW)