This question already has an answer here: Closed 11 years ago. Possible Duplicate: equal k subsets algorithm
Looking开发者_运维百科 for a solution to the subset sum problem for this specific case (in C# or else algorithm):
I have a real-world problem (not homework!) that requires finding the sum of a subset of set A that equals the sum of a subset of some other set B.
I\'ve been struggling with level 3 of the Greplin challenge. For those not familiar, here is the problem:
Given a set of integers, how to find a subset that sums to a given value.开发者_JAVA技巧..the subset problem ?
I know this can be done by sorting the array and taking the larger numb开发者_C百科ers until the required condition is met. That would take at least nlog(n) sorting time.
There is a version of the subset prob开发者_开发问答lem that asks if it is possible to find a subset of a set of integers that add up to the sum of the numbers not in the subset. Anyone know what the
Given a set A containing n positive integers, how can I find the smallest integer >= 0 that can be obtained using all the elements in the set. Each element can be can b开发者_运维百科e either added or
I wonder if there is an elegant way to derive all compositions of 2n as the sum of n non开发者_Python百科-negative integer variables.
Does anyone know how to implement the Sum-of-Subsets problem in Java from this pseudo code? w = an array of positive integers sorted in non-decreasing order.