1/ find the sum of the numbers say S. 2/ if (S is odd) no solution. 3/ s <- S/2; 4/ now the problem became finding the set of numbers from input whose sum is "s". I believe this is known problem...
pramod wrote: > I came across this problem: > Given N positive integers, partition these into two disjoint subsets > with the same sum of their elements (of course, the problem does not > always have a solution). Design an exhaustive search algorithm for > this problem. Try to minimize the number of subsets the algorithm > needs to generate.