Gate2018 cs Q45

0. Consider the weights and values of items listed below. Note that there is only one unit of each item.
Item NumberWeight in (kgs)Value in Rupees)
11060
2728
3420
4224

The value of Vopt − Vgreedy is ______ .

Note – Numerical Type question

  • Option : C
  • Explanation :
    Item No.WeightValueValue/Weight
    110606
    27284
    34205
    422412
    After Sorting
    Item No.WeightValueValue/Weight
    122412
    210606
    34205
    47284
    First, we have to Pick item_1 (Value weight ratio is highest).
    After that Second highest is item_1. but cannot be picked because of its weight.
    Now item_3 shall be picked. item_2 cannot be included because of its weight.
    Therefore, overall profit by Vgreedy = 20+24 = 44
    Hence, Vopt – Vgreedy = 60-44 = 16
    So, answer is 16.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *