Question:medium

Consider the following set of processes with the length of the CPU burst time given in milliseconds:
CPU Burst
The processes are assumed to have arrived in order P1, P2, P3, P4, P5 all at time 0. What is the waiting time of process P4 for Shortest Job First (SJF), non-preemptive priority scheduling, and Round Robin (Quantum=1) scheduling algorithms respectively?

Show Hint

For scheduling algorithms, focus on the execution order and keep track of the time slices or priorities to calculate waiting times.
Updated On: Feb 11, 2026
  • 18, 3, 1
  • 3, 1, 18
  • 18, 3, 3
  • 1, 3, 18
Show Solution

The Correct Option is A

Solution and Explanation

1. Shortest Job First (SJF): The execution order is P2, P4, P3, P5, P1. P4's waiting time is 18 ms, as it commences after P2. 2. Non-preemptive Priority Scheduling: The priority sequence is P2, P5, P3, P1, P4. P4's waiting time is 3 ms, because it begins after all higher-priority processes. 3. Round Robin (Quantum = 1): Round-robin execution proceeds as P1, P2, P3, P4, P5 (time slices). P4's first time slice occurs after all processes have had their initial turn, resulting in a waiting time of 1 ms.
Was this answer helpful?
0