GATE Computer ScienceHardGATE CSE

A fractional knapsack of capacity 20 can take items with (value, weight) = (40,8), (30,5), (24,6), (50,10), (18,3), (35,7), fractions allowed. What is the maximum achievable value?

  1. A. 108
  2. B. 104
  3. C. 112
  4. D. 117

Correct answer: A. 108

Taking items by decreasing value/weight ratio fills the capacity exactly with total value 108.

More Algorithms questions

Exams that ask this topic