Correct Answer - Option 1 : 6.5 ms
The correct answer is option 1.
CONCEPT:
Shortest Job First:
In the SJF scheduling algorithm, the process with the lowest burst time, among the list of available processes in the ready queue, is going to be scheduled next. Preemptive SJF scheduling is the shortest remaining time first
Formula:
TAT=CT-AT
WT=TAT-BT
Gantt Chart:
0 1 5 10 17 26
Process |
Arrival Time(AT) |
Burst Time(BT) |
Completion Time(CT) |
TAT=CT-AT |
WT=TAT-BT |
P1 |
0 |
8 |
17 |
17 |
9 |
P2 |
1 |
4 |
5 |
4 |
0 |
P3 |
2 |
9 |
26 |
24 |
15 |
P4 |
3 |
5 |
10 |
7 |
2 |
Average waiting time= \(\frac{(9+0+15+2) }{4}\)=6.5
∴ Hence the correct answer is 6.5.