What is the average waiting time for the following processes with preemptive SJF (Shortes Job First).
Process Arrival Time Burst Time
P1 0 8P2 1 4P3 2 9P4 3 5
1. 6.5 2. 6.75 3. 7.5 4. 7.75
Gantt Chart for preemptive SJF
P1
P2
P4
P3
0 1 5 10 17 26The average waiting time for this example is ((10-1) + (1-1) + (17-2) + (5-3))/4 = 26/4 = 6.5So, preemptive SJF is better than SJF.