GATE Computer ScienceHardGATE CSE

Items have weights 3, 4, 5, 6, 2 and values 4, 5, 10, 11, 3. For the 0/1 knapsack with capacity 10, the maximum total value is

  1. A. 16
  2. B. 18
  3. C. 17
  4. D. 19

Correct answer: C. 17

The capacity-indexed DP table ends with 17; the fractional-greedy value 19.166666666666664 is not attainable with indivisible items.

More Algorithms questions

Exams that ask this topic