sort the array and from the last elements of the array, put element i(last) in set A and i-1 in set B, now for the i-2 th element put this element in the set whichever has lesser sum of elements in both sets and continue this till the least element
On Dec 22, 7:09 am, Devil Wang <[email protected]> wrote: > *Hi,* > * > * > *I wonder that if the element of the array contains negative integer? > * > > On Wed, Dec 22, 2010 at 1:25 AM, snehal jain <[email protected]> wrote: > > There is an array, how will you partition that into two parts so that > > the sum of both the sub set is minimum > > > -- > > You received this message because you are subscribed to the Google Groups > > "Algorithm Geeks" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<algogeeks%2bunsubscr...@googlegroups > > .com> > > . > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en. > > -- > > ** > * > > Best Regards, > > Devil Wang > > * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
