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}

What is the maximum value of the items you can carry if the maximum weight allowed is 25 (fractional knapsack)?

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

Show answer & explanation

Correct answer: A. 48.1

Explanation

Continuing past capacity 15 (profit 40), add item2 (w 5, p 5): weight 20, profit 45. Then 5/11 of item4: 5/11 × 7 ≈ 3.18. Total ≈ 48.18.

More Data Structures and Algorithms questions