Correct option is A
In Non-Preemptive Shortest Job First (SJF) scheduling, the process with the smallest burst time executes first.
Execution Order:
- P4 = 3 ms
- P1 = 6 ms
- P3 = 7 ms
- P2 = 8 ms
Waiting Times:
- P4 = 0 ms
- P1 = 3 ms
- P3 = 3 + 6 = 9 ms
- P2 = 3 + 6 + 7 = 16 ms
Average Waiting Time:
Average Waiting Time =
Therefore, the average waiting time is 7.0 ms.
Important Key Points:
- SJF scheduling executes the process with the shortest burst time first.
- In Non-Preemptive SJF, once a process starts execution, it cannot be interrupted.
- Waiting time is calculated as the total time a process waits before execution.
- SJF generally provides the minimum average waiting time among scheduling algorithms.
Knowledge Booster:
- (b) 5.5 ms: Incorrect because the waiting times are not calculated correctly according to SJF execution order.
- (c) 6.25 ms: Incorrect because this value results from an incorrect summation of waiting times.
- (d) 5.0 ms: Incorrect as per the actual calculation; the correct average waiting time is 7.0 ms.
- (e) 6.0 ms: Incorrect because the computed average waiting time does not equal 6.0 ms.