in reply to Re: Divide array of integers into most similar value halves
in thread Divide array of integers into most similar value halves

Dageek,

this is a great idea!!! I'm gonna try it.
By adding the next value to the smallest group the result should be close to optimum.
Also simple and fast

Thanks a lot
Pepe
  • Comment on Re^2: Divide array of integers into most similar value halves

Replies are listed 'Best First'.
Re^3: Divide array of integers into most similar value halves
by bduggan (Pilgrim) on Sep 03, 2008 at 13:56 UTC
    It'll fail for e.g. (3,3,2,2,2) and other sets where the top two numbers are odd, the rest even, and the ideal split is even. (and other cases too, e.g. (10,10,4,4,4,4,4))
      You're right bduggan,
      Although it may be close enough for me
      Excellent point! Thanks!

      Enjoy!
      Dageek