Question:

Three processes arrive at time 0 with burst times 5, 3, and 1 unit respectively. The scheduler always selects the process with the smallest burst time next. The order of execution will be?

Show Hint

SJF is the "Provably Optimal" algorithm for minimizing average waiting time. By getting the "short" jobs out of the way quickly, we prevent them from waiting behind long-running jobs (avoiding the Convoy Effect).
Updated On: Jul 4, 2026
  • $5 \to 3 \to 1$
  • $1 \to 3 \to 5$
  • $3 \to 1 \to 5$
  • $1 \to 5 \to 3$
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Concept:
The scheduling policy described is Shortest Job First (SJF). In SJF, when the CPU becomes available, the scheduler looks at all ready processes and selects the one with the smallest CPU burst time. If multiple processes are available at the same arrival time, the one with the minimum requirement is prioritized to reduce the average waiting time of the system.

Step 1:
Analyze the "Ready Queue" at Time $T=0$.
Since all processes arrive at the same time ($T=0$), they are all competing for the CPU simultaneously:
• Process A: Burst = 5
• Process B: Burst = 3
• Process C: Burst = 1

Step 2:
Apply the SJF Logic.
The scheduler compares the values $\{5, 3, 1\}$.
First: Process C has the smallest burst (1). It is selected and runs to completion.
Second: Once C is done, the scheduler compares the remaining $\{5, 3\}$. Process B (3) is smaller than Process A (5), so B executes next.
Third: Finally, Process A (5) is executed.

Step 3:
Visualizing the Gantt Chart.
The timeline of execution looks like this:
• $[0 - 1]$ : Process with burst 1 executes.
• $[1 - 4]$ : Process with burst 3 executes.
• $[4 - 9]$ : Process with burst 5 executes. The order of the jobs being handled by the CPU is $1 \to 3 \to 5$.
Was this answer helpful?
0
0