Currently Being Moderated
Hi!
I have heard of the knapsack problem and I wanted to try to solve it. According to wikipedia, an algorithm to solve the knapsack problem should decide the number of each item to bring. http://en.wikipedia.org/wiki/Knapsack_problem
In this example http://www.cs.princeton.edu/introcs/96optimization/Knapsack.java.html that shows dynamic programming, the program does not determine how many of each item to bring, just if they should be brought or not.
Is this example not a complete algorithm to solve the problem? Or have I misunderstood wikipedia?