GATE Computer ScienceHardGATE CSE · UGC NET

Unit-time jobs with (deadline, profit): (2,100), (1,19), (2,27), (1,25), (3,15), (3,90), (4,60), (5,10). Each job takes one slot and must finish by its deadline. The maximum total profit is

  1. A. 272
  2. B. 297
  3. C. 187
  4. D. 287

Correct answer: D. 287

Taking jobs by decreasing profit into the latest free slot accepts profits 100, 90, 60, 27, 10; total 287 (confirmed by exhaustive search).

More Algorithms questions

Exams that ask this topic