View worked solution
Answer: 29
We use the preemptive priority scheduling algorithm where represents the highest priority. Let's trace the execution of the processes chronologically:
- At : Only (Priority 2) is available. It starts execution.
- At : (Priority 1) arrives. Since has a higher priority than , is preempted.
Remaining burst of . - At : (Priority 0) arrives. Since has the highest priority, it preempts .
Remaining burst of . - At to : runs to completion because it has the highest possible priority (). It finishes at .
- At : Among the ready processes (), (Priority 1) is executed next. It finishes at .
- At : Among the remaining processes (), (Priority 2) is executed. It finishes at .
- At : Between (Priority 3) and (Priority 4), is executed. It finishes at .
- At : is executed. It finishes at .
We can now construct the scheduling table to find the waiting time ():
| Process | Arrival Time (AT) | Burst Time (BT) | Completion Time (CT) | Waiting Time (WT) |
|---|---|---|---|---|
| 0 | 11 | 49 | ||
| 5 | 28 | 33 | ||
| 12 | 2 | 51 | ||
| 2 | 10 | 40 | ||
| 9 | 16 | 67 |
The average waiting time is calculated as:
Free practice · Your answers on this page are not saved.
