Data Structures & AlgorithmsHardGATE CS · ICPC regional

Five jobs (processing time, due date) are [(4, 9), (2, 6), (6, 12), (3, 7), (5, 10)]. They run one at a time with no preemption, starting at time 0 in any order you choose. What is the smallest possible maximum lateness (max of completion time − due date)?

  1. A. 8
  2. B. 10
  3. C. 20
  4. D. 9

Correct answer: A. 8

Earliest Due Date (EDD) order is optimal for maximum lateness: sort by due date and run the jobs back to back. Shortest-processing-time order minimises total completion time, not lateness, and can make the job with the earliest due date finish last.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic