Skip to main content

FCFS, SJF, RR Gantt and turnaround

Short answer

FCFS mean turnaround time =58, SJF =37, Round Robin (q=5) =53 time units.

Suppose 5 processes are submitted at time 0.

ProcessABCDE
Burst Time351015520
Priority32451
Show the execution timeline of the processes using Gantt Chart for FCFS, SJF and Round Robin (q=5). Also calculate mean turnaround time in each case.

All five processes arrive at time 0, so turnaround time = completion time and waiting time = turnaround − burst. The priority row is not needed for these three algorithms.

FCFS

| A | B | C | D | E |
0   35  45  60  65  85
ProcessArrivalBurstCompletionTurnaroundWaiting
A03535350
B010454535
C015606045
D05656560
E020858565

Average waiting time = 205/5 = 41; average turnaround time = 290/5 = 58

SJF (non-preemptive; shortest burst first)

| D | B | C | E | A |
0   5   15  30  50  85
ProcessArrivalBurstCompletionTurnaroundWaiting
A035858550
B01015155
C015303015
D05550
E020505030

Average waiting time = 100/5 = 20; average turnaround time = 185/5 = 37

Round Robin (q = 5)

| A | B | C | D | E | A | B | C | E | A | C | E | A |
0   5   10  15  20  25  30  35  40  45  50  55  60  65
| E | A |
65  70  85
ProcessArrivalBurstCompletionTurnaroundWaiting
A035858550
B010353525
C015555540
D05202015
E020707050

Average waiting time = 180/5 = 36; average turnaround time = 265/5 = 53

Mean turnaround time

AlgorithmMean turnaround time
FCFS58
SJF37
Round Robin (q=5)53

Answer: FCFS = 58, SJF = 37, RR (q=5) = 53 time units. SJF is best; FCFS is worst because the long process A comes first.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 2 questions →