how about 1.sorting the elements 2.moving 2 pointers ; one from first and one from last 3.group the elements that the 2 pointers pointing to until the number of elements it has grouped is less than or equal to half of the arraysize.
On May 14, 3:53 pm, Rohit Saraf <[email protected]> wrote: > A simple DP should work. Should it not? > > -------------------------------------------------- > Rohit Saraf > Second Year Undergraduate, > Dept. of Computer Science and Engineering > IIT Bombayhttp://www.cse.iitb.ac.in/~rohitfeb14 > > On Fri, May 14, 2010 at 4:15 PM, Sathaiah Dontula <[email protected]>wrote: > > > > > Any assumption like, it has even number of elements and two distinct sets ? > > > Thanks, > > Sathaiah > > > On Fri, May 14, 2010 at 2:21 PM, divya <[email protected]> wrote: > > >> Algorithm to partition set of numbers into two s.t. diff bw their > >> sum is min and they hav equal num of elements > > >> -- > >> 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%[email protected]> > >> . > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. > > > -- > > 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%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/algogeeks?hl=en. > > -- > 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 > athttp://groups.google.com/group/algogeeks?hl=en. -- 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.
