Q.

Which of the following statement about 0/1 knapsack and fractional knapsack problem is correct?

A. in 0/1 knapsack problem items are divisible and in fractional knapsack items are indivisible
B. both are the same
C. 0/1 knapsack is solved using a greedy algorithm and fractional knapsack is solved using dynamic programming
D. in 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible
Answer» D. in 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible
Explanation: in fractional knapsack problem we can partially include an item into the knapsack whereas in 0/1 knapsack we have to either include or exclude the item wholly.
1.7k
0
Do you find this helpful?
1

Discussion

No comments yet