Title Subset Sum Problem Find all subsets S1 S2 S3 Sn for a
Title: Subset Sum Problem Find all subsets S1, S2, S3, ...., Sn for a given set S = { e1, e2,......, en} of n positive integers whose sum is equal to a positive integer D. For an example, S={2, 6, 8, 5, 1, 10} and D = 9, there are two subsets (solutions): S1={2, 6, 1} and S2={8, 1}. In our search tree, every path from root node to ithlevel represents a subset of S. If sum of the element values that are included in a path is equal to D, then we have a solution to the problem. If the subset sum becomes greater than D, then we should not further explore that path (pruning!!). Any Java code to accomplish this would be appreciated!
Solution
#include