TAT = Completion Time - arrival time
First Come First Serve
0 A 3 |
3 B 9 |
9 C 13 |
13 D 15 |
TAT : for A ( 3-0) = 3
for B (9 - 1) = 8
for C ( 13 - 4) = 9
for D (15 - 6) = 9
so Avg TAT = (3+8+9+9 ) / 4 = 29 /4 = 7.25 for FCFS .
--------------
Round Robin with Quantum value two
0 A 2 |
2 B 4 |
4 A 5 |
5 C 7 |
7 B 9 |
9 D 11 |
11 C 13 |
13 B 15 |
In RR after preemption a process go to end of that FIFO queue , so here first A is in queue then at time 1 B comes , time quantum is 2 so after 2 A is preempted then A go to end of queue after B as in queue only A and B is there . Now B continue till 4 then at that time C is in queue so B goes after C . As A was after B so when B preempted at 4 that time A starts and completes at 5 then C comes and at 7 C completes . At this point D arrive and go to after B in queue . Next B continue and C goes after D . B continue till 9 then D starts and go to till 11 . Then again C comes and complete at 13 at last element of queue is B it completes rest at 15.
so the order in queue is like this A B A C B D C B
Avg TAT = { ( 5-0) + (15-1) + (13-4) + (11 - 6) } / 4 = 5+14+9+5 / 4 = 33/4 = 8.25
------------
Shortest Remaining Time (SRTF)
0 A 3 |
3 B 4 |
4 C 8 |
8 D 10 |
10 B 15 |
A start at 0 then at 1 B comes but A have remaining time 2 and B have remaining time 5 so 2<5 and A continues till 3 , then B starts at 4 C comes , remaining time for B is 5 and C is 4 as 4<5 so C starts at 6 D comes , remaining time for B is 5 and 5>2 and for C remain is 2 , 2 = 2 so C continues after that D comes and at last B completes .
Avg TAT is = { (3-0) + (15-1)+(8-4) + (10-6) } / 4 = (3+14+4+4) / 4 = 25/4 = 6.25
---------------
Non-preemprive Shortest job first ( SJF)
0 A 3 |
3 B 9 |
9 D 11 |
11 C 15 |
Avg TAT = { (3-0) + (9-1)+ (15-4) + (11- 6) } / 4 = (3+8+11+5) / 4 = 27/4 = 6.75
so we can see , Avg TAT for FCFS = 7.25 , SJF = 6.75 , SRTF = 6.25 and RR = 8.25 .
SRTF is less among them hence answer is option C .