GATE 2011 CS (CS1) – Question 45
Processes P₀,P₁,P₂ have arrivals 0,1,2 ms and bursts 9,4,9 ms respectively. Use preemptive shortest-job-first, scheduling only at arrivals/completions. Find average waiting time.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) 5.0 ms
Explanation
P₀ runs 0–1 then P₁ preempts and completes at five. P₀ has eight remaining, less than P₂’s nine, so P₀ runs 5–13, then P₂ runs 13–22. Waiting times are 13−0−9=4, 5−1−4=0 and 22−2−9=11. Average is (4+0+11)/3=5 ms, A.