Question DSA-GRDY-0010
MediumWhy does greedy work for the fractional knapsack but not for the 0/1 knapsack?
- A.
In 0/1 knapsack items can't be split, so taking the best ratio first may waste capacity
- B.
Fractional knapsack is NP-hard
- C.
Greedy works for both
- D.
0/1 knapsack has no weights
Sign up free to see the answer and a step-by-step explanation.