McqMate
| 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. | |
View all MCQs in
Design and Analysis of AlgorithmsNo comments yet