Consider the weights and values of items listed below. Note that there is only one unit of each item.
Item number Weight (in Kgs) Value (in Rupees)
1 10 60
2 7 28
3 4 20
4 2 24
The task is to pick a subset of these items such that their total weight is no more than 11 Kgs and their total value is maximized. Moreover, no item may be split. The total value of items picked by an optimal algorithm is denoted by . A greedy algorithm sorts the items by their value-to-weight ratios in descending order and packs them greedily, starting from the first item in the ordered list. The total value of items picked by the greedy algorithm is denoted by .
The value of is ____________.
GATE CS 2018 (Forenoon) — Question 58
AlgorithmsGreedy Approach & Divide-and-Conquer DesignsNAT2 marksMedium
A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.
More on Greedy Approach & Divide-and-Conquer Designs
- GATE CS 2021 (Afternoon) · Q36Consider the string abbccdddee. Each letter in the string must be assigned a binary code satisfying the following properties: 1. For any tw…
- GATE CS 2017 (Forenoon) · Q5Consider the following table: Match the algorithms to the design paradigms they are based on.
- GATE CS 2017 (Afternoon) · Q50A message is made up entirely of characters from the set X = \ P, Q, R, S, T\ . The table of probabilities for each of the characters is sh…

