• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to device an algorithim...your 2 cents are appreciated  RSS feed

 
Abhishk Gupta
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disclaimer: Please move this post to right forum, if this is not the one.

Problem Statement: We have a set of numbers. Let's say {1,2,3,4,5,6,7,8,9}. We need to find out, summation of what combination of number will produce 9, 15 or any other number.

e.g.

9=1+2+6
9=1+3+5
...
...
etc.


I have knowingly taken a smaller set. In real world, this would be huge. Hence trying to figure out a highly optimized solution.


Thanks
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you have a version of the knapsack problem
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!