M

Mr. Dubey • 52.30K Points
Coach

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
Correct : Option (D)

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.

Share

Discusssion

Login to discuss.

Loading Comments....