edited by
12,687 views
29 votes
29 votes

Consider the following table of arrival time and burst time for three processes $P0, P1$ and $P2.$$$\small \begin{array}{|c|c|c|} \hline \textbf{Process} & \textbf{Arrival Time} & \textbf{Burst Time}\\\hline \text{P0} & \text{0 ms} & 9 \\\hline \text{P1} & \text{1 ms} & 4 \\\hline \text{P2} & \text{2 ms} & 9 \\\hline  \end{array}$$The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?

  1. $5.0$ ms
  2. $4.33$ ms
  3. $6.33$ ms
  4. $7.33$ ms
edited by

2 Answers

Best answer
33 votes
33 votes

Answer is (A). $5$ms

Gantt Chart

$\text{ Average Waiting Time = } \dfrac{(0+4)+(0)+(11)}{3} = \text{ 5ms. }$

edited by
0 votes
0 votes

P   AT    BT      CT    TAT   WT

P0    0     9,8,0   13    13    4

P1    1     4,0     5     4     0

P2    2     9,0     22    20    11

P0,P1,P0,P1

Avg, waiting time = 15/3  = 5 Option A

Answer:

Related questions