---
title: "FCFS, SJF, RR Gantt and turnaround"
subject: "Operating System"
chapter: 2
key: "semester_6/operating_system:fcfs-sjf-rr-q5-timeline"
source: https://www.bctengineer.com/q/semester_6/operating_system/fcfs-sjf-rr-q5-timeline
site: BCT Engineering
---

# FCFS, SJF, RR Gantt and turnaround

Operating System · Chapter 2: Process Management

- Asked in: 2074 Bhadra, 6 marks
- Video: [L-2.3: First Come First Serve(FCFS) CPU Scheduling Algorithm with Example](https://www.youtube.com/watch?v=MZdVAVMgNpA) — Gate Smashers
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/operating_system/fcfs-sjf-rr-q5-timeline
- Whole chapter: https://www.bctengineer.com/md/semester_6/operating_system/chapter-2

## Question

Suppose 5 processes are submitted at time 0.
| Process | A | B | C | D | E |
|---|---|---|---|---|---|
| Burst Time | 35 | 10 | 15 | 5 | 20 |
| Priority | 3 | 2 | 4 | 5 | 1 |
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.

## Short answer

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

## Answer

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**

```text
| A | B | C | D | E |
0   35  45  60  65  85
```

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 35 | 35 | 0 |
| B | 0 | 10 | 45 | 45 | 35 |
| C | 0 | 15 | 60 | 60 | 45 |
| D | 0 | 5 | 65 | 65 | 60 |
| E | 0 | 20 | 85 | 85 | 65 |

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

**SJF (non-preemptive; shortest burst first)**

```text
| D | B | C | E | A |
0   5   15  30  50  85
```

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 85 | 85 | 50 |
| B | 0 | 10 | 15 | 15 | 5 |
| C | 0 | 15 | 30 | 30 | 15 |
| D | 0 | 5 | 5 | 5 | 0 |
| E | 0 | 20 | 50 | 50 | 30 |

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

**Round Robin (q = 5)**

```text
| 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
```

| Process | Arrival | Burst | Completion | Turnaround | Waiting |
|---|---|---|---|---|---|
| A | 0 | 35 | 85 | 85 | 50 |
| B | 0 | 10 | 35 | 35 | 25 |
| C | 0 | 15 | 55 | 55 | 40 |
| D | 0 | 5 | 20 | 20 | 15 |
| E | 0 | 20 | 70 | 70 | 50 |

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

#### Mean turnaround time

| Algorithm | Mean turnaround time |
|---|---|
| FCFS | 58 |
| SJF | 37 |
| 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.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is the priority row not used in this problem?
   A. It is an error in the question
   B. FCFS, SJF and RR do not use priorities
   C. Priorities are only for processes arriving later
   D. All priorities are equal
   Answer: B. Only FCFS, SJF and RR are asked, none of which uses priority. (Key point: Priority row unused)

2. What is the SJF execution order and mean turnaround time?
   A. A, B, C, D, E; 58
   B. D, B, C, E, A; 37
   C. E, A, C, B, D; 53
   D. D, B, C, E, A; 20
   Answer: B. Shortest first: D(5), B(10), C(15), E(20), A(35); completions 5, 15, 30, 50, 85 sum to 185, giving 37. (Key point: SJF order)

3. What is the FCFS mean turnaround time?
   A. 41
   B. 58
   C. 37
   D. 85
   Answer: B. Completions 35, 45, 60, 65, 85 sum to 290; 290/5 = 58 (41 is the mean waiting time). (Key point: FCFS mean turnaround)

4. What is the RR (q=5) mean turnaround and which process finishes first?
   A. 53; D finishes first at 20
   B. 58; A finishes first
   C. 37; D finishes at 5
   D. 53; B finishes first at 10
   Answer: A. D (5) completes in its first turn, finishing at 20 in the cycle; turnarounds 85, 35, 55, 20, 70 sum to 265, giving 53. (Key point: RR q=5 result)

## Related in Operating System

- [FCFS, SJF, Priority, RR Gantt; max AWT](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Ascheduling-gantt-fcfs-sjf-priority-rr-q2) — Operating System, chapter 2
- [Avg turnaround: FCFS, RR, SJF, SRT, HRRN](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aavg-turnaround-fcfs-rr-sjf-srt-hrrn) — Operating System, chapter 2
- [RR, preemptive priority, preemptive SJF](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Aprocess-rr-priority-preemptive-sjf) — Operating System, chapter 2
- [CPU criteria; RR Gantt and times](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Acpu-criteria-rr-gantt) — Operating System, chapter 2
- [Preemptive priority and SRTF Gantt](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-priority-srtf-gantt) — Operating System, chapter 2
- [Two processors: priority and RR (q=3)](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Atwo-processor-priority-rr-q3) — Operating System, chapter 2

## Related in other subjects

- [Round robin scheduling (9, 6, 3 ms, q=2)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-9-6-3-q2) — Embedded System, chapter 6, asked 4×
- [Round robin scheduling (6, 4, 2 ms, q=2)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-6-4-2-q2) — Embedded System, chapter 6, asked 4×
- [CPU free percentage with I/O (round robin)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Acpu-free-percentage-rr) — Embedded System, chapter 6
- [Round robin scheduling (9, 6, 3 ms, q=3)](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asched-rr-9-6-3-q3) — Embedded System, chapter 6, asked 4×
