Results 1 to 5 of 5

Thread: Algorithm to get closest number set

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2002
    Posts
    101

    Question Algorithm to get closest number set

    Good day,

    Let say we hv a number set {11, 22, 33, 44, 55, 66, 77, 88, 99, 111}. Is there any algorithm that can give me a subset {x1, x2, x3, ...} where the sum of the subset closest and less than to 150 , for example ?

    E.g.,

    11+22 = 33
    11+22+33+44 = 110
    11+22+33+44+55 = 165

    So the answer using the above example would be {11, 22, 33, 44} as it gives the closest 10 150. Is there any algorithm to get this set ?

    Thanks.

    SonicWave
    Last edited by SonicWave; Jul 22nd, 2006 at 03:07 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width