All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · December 2022 Shift 1

Directions (Q91–95): For a knapsack problem, P and W are the profits and weights of a set of 7 items:
P = {9, 5, 2, 7, 6, 16, 9}
W = {2, 5, 6, 11, 1, 9, 3}

The most efficient solution to the fractional knapsack problem with maximum capacity 15 is obtained using ___

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. Greedy Algorithm

Explanation

Taking items in decreasing order of profit/weight ratio (greedy) is optimal for the fractional knapsack.

More Data Structures and Algorithms questions