GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Six tasks have (processing time, deadline): (3,6), (2,8), (4,9), (1,5), (5,15), (2,10). They run one after another on a single machine starting at time 0, and lateness = completion time − deadline. The minimum possible value of the maximum lateness over all orders is:

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 1

Correct answer: C. 2

Earliest-deadline-first is optimal for minimising maximum lateness (exchange argument): the order by deadline 5, 6, 8, 9, 10, 15 gives completion times 1, 4, 6, 10, 12, 17 and lateness −4, −2, −2, 1, 2, 2, maximum 2. Shortest-processing-time order gives 3.

More Algorithms questions

Exams that ask this topic