It is called well known subset sum problem. Backtracking suits well
for such optimization problems. Read material on state space methods
of solving subset sum problem.

Regards,
Venki.

On Apr 18, 4:16 pm, kamlesh yadav <kamleshlu2...@gmail.com> wrote:
> given an array of elements (all elements are unique ) , given a sum
> s   find all the subsets having sum s.
>
> for ex  array {5,9,1,3,4,2,6,7,11,10}
>
> sum is 10
>
> possible subsets are     {10},  {6,4}     ,{7,3}      {5,3,2}
> {6,3,1}  etc.    there can be many more.
> also find the total number of these subsets

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to