Question discussion

In a 0/1 knapsack of capacity 9, the items (weight, value) are (3, 40), (4, 50), (5, 70) and (2, 25). The maximum total value that can be c…

1373Medium DSSSB TGT Computer Science 0 replies

In a 0/1 knapsack of capacity 9, the items (weight, value) are (3, 40), (4, 50), (5, 70) and (2, 25). The maximum total value that can be carried is

  • A110
  • B115
  • C125
  • D120
Correct answer: D

Explanation

The best choice is the items of weight 5 and 4 (weight 9, value 120); greedy-by-ratio would take 5 and 3 for only 110.

Discussion 0

Nobody has replied yet. Start the discussion!