CSS Optional — Paper-II, Section-A · P-II.III.II (cont.) · Scheduling-algorithm Gantt-chart numericals are the single most-repeated OS numerical type across past papers. The [Process Management] page gives the summary table; this page works every algorithm through a full worked numerical, step by step, so the method is drilled, not just memorized.

1. The General Method (applies to every algorithm below)

  1. List each process with Arrival Time (AT) and Burst Time (BT) [+ Priority if relevant].
  2. Draw the Gantt chart by simulating the algorithm's rule tick-by-tick (preemptive) or event-by-event (non-preemptive).
  3. Read off each process's Completion Time (CT) from the chart.
  4. Turnaround Time (TAT) = CT − AT.
  5. Waiting Time (WT) = TAT − BT.
  6. Average TAT / WT = sum ÷ number of processes.

Always show all four columns (CT, TAT, WT) even if only the average is asked for — the intermediate values carry marks, and a correct Gantt chart alone earns partial credit even with an arithmetic slip later.

2. FCFS — Worked Numerical

Process AT BT
P1 0 5
P2 1 3
P3 2 8
P4 3 6

FCFS simply runs processes in the order they arrive, no preemption:

  1. t=0: only P1 has arrived → run P1 for its full burst (0→5).
  2. t=5: P1 finishes. P2 (arrived t=1) and P3 (arrived t=2) are both waiting → P2 arrived first → run P2 (5→8).
  3. t=8: P2 finishes. P3 and P4 are waiting → P3 arrived first (t=2) → run P3 (8→16).
  4. t=16: P3 finishes. Only P4 left → run P4 (16→22).
Gantt:  | P1(0-5) | P2(5-8) | P3(8-16) | P4(16-22) |
Process CT TAT (CT-AT) WT (TAT-BT)
P1 5 5 0
P2 8 7 4
P3 16 14 6
P4 22 19 13

Avg TAT = 45/4 = 11.25 · Avg WT = 23/4 = 5.75. Notice P3's 6-unit wait and P4's 13-unit wait despite short arrival gaps — this pile-up behind long jobs is the convoy effect, FCFS's signature weakness.

3. SJF (Non-Preemptive) — Worked Numerical