Answer:Option II Solution:Preemptive shortest job first scheduling algorithm
Preemptive SJF algorithm will preempt the currently executing process. Preemptive SJF scheduling is sometimes called shortest remaining time first algorithm.
Formula used,Turn Around Time = Completion Time - Arrival Time,
Waiting Time = Turn Around Time - Burst Time,
Average Waiting Time = Total waiting Time / number of process
Calculation,Gantt Chart
Completion Time(CT) for P1 = 12,
Completion Time(CT) for P2 = 5,
Completion Time(CT) for P3 = 21,
Turn Around Time(TAT) for P1 = CT-AT = 12-0 = 12,
Turn Around Time(TAT) for P2 = CT-AT = 5-1 = 4,
Turn Around Time(TAT) for P3 = CT-AT = 21-2 = 19,
Waiting Time(WT) for P1 = TAT-BT = 12-8 = 4,
Waiting Time(WT) for P2 = TAT-BT = 4-4 = 0,
Waiting Time(WT) for P3 = TAT-BT = 19-9 = 10.
Average Waiting Time = (4+0+10)/3
= 14/3
= 4.66
So, Option(II)is correct.