Subset Sum Algorithm
for k = 1 to n do
for i = b to 0
if A[i] = 1 and ak + i < b then
A[ak + i] := 1
if A[b] = 1 then some subset adds up to b
Time Complexity is O((b+1)n)
Previous slide
Next slide
Back to first slide
View graphic version