Computer Science EngineeringHardISRO SC (CS)

0/1 knapsack: item weights [4, 3, 3, 8, 7], values [18, 11, 18, 8, 4], capacity 15. The maximum total value is:

  1. A. 47
  2. B. 46
  3. C. 50
  4. D. 45

Correct answer: A. 47

DP over capacity gives 47; the greedy value/weight-ratio choice yields 47, which need not be optimal.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic