Skip to content
GATEiit

GATE CSE 2020 Q60: Difference of average turnaround times for SJF and RR (q = 4)

Question

Consider the following set of processes, assumed to have arrived at time 0. Consider the CPU scheduling algorithms Shortest Job First (SJF) and Round Robin (RR). For RR, assume that the processes are scheduled in the order P1,P2,P3,P4P_1, P_2, P_3, P_4.

ProcessesP1P_1P2P_2P3P_3P4P_4
Burst time (in ms)8724

If the time quantum for RR is 4 ms, then the absolute value of the difference between the average turnaround times (in ms) of SJF and RR (round off to 2 decimal places) is _______.

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 5.25 (official GATE 2020 final answer key)

Concept used: With all arrivals at 0, turnaround time equals completion time; draw a Gantt chart for each policy.

First step: SJF runs P3,P4,P2,P1P_3, P_4, P_2, P_1 finishing at 2, 6, 13, 21. For RR with quantum 4, the slices are P1,P2,P3,P4,P1,P2P_1, P_2, P_3, P_4, P_1, P_2.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2020 CS question paper and final answer key, organised by IIT Delhi. Question paper · Answer key