All mock tests are FREE till 31 December — register to save your progress

Three processes arrive as follows:
ProcessArrival TimeBurst Time
P00 ms7 ms
P11 ms3 ms
P22 ms7 ms
The preemptive shortest-job-first (SJF) scheduling algorithm is used, with scheduling decisions made only at a process arrival or completion. What is the average waiting time for the three processes?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 3.67 ms

Explanation

Trace: at t=0 only P0 (remaining 7) runs. At t=1, P1 (remaining 3) arrives and preempts P0 since 33.67 ms, option (ii).

More Discrete Structures and Optimization questions