This problem is known as the subset sum problem, which is a special case of the Knapsack problem. Wikipedia is a good starting point for some algorithms.
More Related Contents:
- The most efficient way to implement an integer based power function pow(int, int)
- Power by squaring for negative exponents
- Explain this snippet which finds the maximum of two integers without using if-else or any other comparison operator?
- How do you print the EXACT value of a floating point number?
- C – How to implement Set data structure?
- Gaussian elimination without result for acceleration
- signed and unsigned arithmetic implementation on x86
- Floating point linear interpolation
- A possible algorithm for determining whether two strings are anagrams of one another? [closed]
- Recursive and non-recursive traversal of three degree tree
- how to show time performance for merge sort? [closed]
- C pointer to another struct
- Sum of the all the numbers between a and b [closed]
- All Possible Combinations of a list of Values
- Calculating factorial of large numbers in C
- Rounding integer division (instead of truncating)
- Algorithm to find which numbers from a list of size n sum to another number
- “undefined reference to `pow'” even with math.h and the library link -lm [duplicate]
- Program to print permutations of given elements [closed]
- Fastest way to calculate a 128-bit integer modulo a 64-bit integer
- Special simple random number generator
- Lookups on known set of integer keys
- Why does gdb evaluate sqrt(3) to 0?
- Sorting an array in C?
- Inverting a 4×4 matrix
- implementation of rand()
- sin, cos, tan and rounding error
- forwarding (drawing) line in 3d grid
- Algorithm to generate bit mask
- How does this bitwise operation check for a power of 2?