Which of the following statement about 0/1 knapsack and fractional knapsack…

2025

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

  1. A.

    In 0/1 knapsack problem items are divisible and in fractional knapsack items are indivisible

  2. B.

    Both are the same

  3. C.

    0/1 knapsack is solved using a greedy algorithm and fractional knapsack is solved using dynamic programming

  4. D.

    In 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible

Attempted by 125 students.

Show answer & explanation

Correct answer: D

Answer: 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.

Explore the full course: Coding For Placement