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
πŸ’¬ Discuss
βœ… Correct 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.

Explanation by: Mr. Dubey
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.

πŸ’¬ Discussion

πŸ“Š Question Analytics

πŸ‘οΈ
898
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
80%
Success Rate