CS FundamentalsVery hardGATE CS

Assertion (A): Shortest Remaining Time First is optimal for average waiting time when preemption is free. Reason (R): Running the job with the least remaining work first minimises the number of jobs waiting at every instant.

  1. A. Both A and R are true, but R is not the correct explanation of A
  2. B. A is true but R is false
  3. C. A is false but R is true
  4. D. Both A and R are true, and R is the correct explanation of A

Correct answer: D. Both A and R are true, and R is the correct explanation of A

Average waiting equals the time integral of the number of waiting jobs divided by n. Finishing the smallest remaining job first reduces that count as early as possible (exchange argument), which is why SRTF is optimal.

More Operating Systems questions

Exams that ask this topic