Non-preemptive SJF with all arrivals at t = 0 runs the shortest burst first: P2 (2), P1 (4), P4 (6), P3 (8).
Gantt chart: | P2 0–2 | P1 2–6 | P4 6–12 | P3 12–20 |
| Process | Burst | Completion | Waiting |
| P1 | 4 | 6 | 2 |
| P2 | 2 | 2 | 0 |
| P3 | 8 | 20 | 12 |
| P4 | 6 | 12 | 6 |
Waiting time = completion time − burst time (arrival is 0 for all).
Average waiting time = (2 + 0 + 12 + 6) / 4 = 20 / 4 = 5 time units.
— rhs