Question DSA-GRDY-0073
HardWhy does greedy fail for 0/1 knapsack with capacity 50 and items (60, 10), (100, 20), (120, 30)?
- A.
It doesn't fail
- B.
Greedy by ratio takes the first two (160 value, 30 weight) and can't fit the third, but 100 + 120 = 220 is better
- C.
Sign up free to see the answer and a step-by-step explanation.