Dec 30, 2008

Given a list of integers {5, 5, 10, 5}. Output the list of integers that will sum up to 15.

Given a list of integers {5, 5, 10, 5}. Output the list of integers that will sum up to 15.
e.g. {5, 10}, {5, 10}, {10, 5}, {5, 5, 5,}
Generalize the algorithm to work on any input size.

np complete see below
http://en.wikipedia.org/wiki/Subset_sum_problem

No comments:

Post a Comment