Consider the following processes with their CPU burst times: Process Burst Time P1 4 P2 2 P3 8 P4 6 Assume that all processes arrive at time t = 0…

Consider the following processes with their CPU burst times:

ProcessBurst Time
P14
P22
P38
P46

Assume that all processes arrive at time t = 0 and are scheduled using the Non-Preemptive Shortest Job First (SJF) scheduling algorithm.

  1. Calculate the completion time of each process (P₁, P₂, P₃, and P₄).
  2. Calculate the waiting time of each process and the average waiting time.

From the BPDB Assistant Engineer (CSE) October 2026 – Written (BUET) exam, question 21 of 30.

Answers (1)

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 |

ProcessBurstCompletionWaiting
P1462
P2220
P382012
P46126

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

More from this paper