GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Ten unit-time jobs have (deadline, profit): (2,95), (1,60), (2,40), (3,85), (3,30), (1,25), (4,70), (2,20), (4,55), (5,15). Each job takes one time slot and earns its profit only if finished by its deadline; one job per slot. What is the maximum total profit?

  1. A. 305
  2. B. 325
  3. C. 340
  4. D. 365

Correct answer: B. 325

Take jobs in decreasing profit and put each in the latest free slot at or before its deadline: 95 → slot 2, 85 → 3, 70 → 4, 60 → 1, then 55, 40, 30 find no free slot, and 15 takes slot 5: total 325. A brute force over all subsets also gives 325; 365 is the infeasible top-five sum.

More Algorithms questions

Exams that ask this topic