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 <rohit.kumar.sa...@gmail.com> 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 <don.sat...@gmail.com>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 <sweetdivya....@gmail.com> 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 algoge...@googlegroups.com. > >> To unsubscribe from this group, send email to > >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > >> . > >> 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 algoge...@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > > . > > 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 algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > 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 algoge...@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.