Solution
The correct answer is option 4.
CONCEPT:
Shortest Job First (non-preemptive): Among the processes present in the ready queue at any instant, the one with the smallest burst time is selected and run to completion.
Round Robin (time quantum = 10): Processes are executed in FCFS order for a fixed time slice (quantum). If a process is not finished after its quantum, it is placed at the end of the ready queue.
Formulae (for reference):
TAT = CT − AT and WT = TAT − BT
Given:
P1(BT=9, AT=0), P2(30,0), P3(4,0), P4(8,2), P5(11,6)
Non-preemptive SJF – Gantt Chart:
0 4 12 21 32 62
Completion order: P3, P4, P1, P5, P2 → Second last = P5.
Round Robin (TQ = 10) – Gantt Chart:
| P1(9) |
P2(10/30) |
P3(4) |
P4(8) |
P5(10/11) |
P2(10/20) |
P5(1/1) |
P2(10/10) |
0 9 19 23 31 41 51 52 62
Completion times: P1=9, P3=23, P4=31, P5=52, P2=62 → Second last = P5.
Therefore, SJF: P5; RR: P5 — correct option is 4.