Consider three processes (process id 0,1,2 respectively) with compute ...
Turn around time of a process is the total time between submission of the process and its completion. LRTF (Longest Remaining Time First), means the process which has the remaining time largest, will run first and in case of the same remaining time, the lowest process will be given priority to run.
Let the processes be p0, p1 and p2. These processes will be executed in the following order.
Gantt chart is as follows:
First 4 sec, p2 will run, then remaining time p2 = 4, p1 = 4, p0 = 2.
Now, p1 will get chance to run for 1 sec, then remaining time p2 = 4, p1 = 3, p0 = 2.
Now, p2 will get chance to run for 1 sec, then remaining time p2 = 3,p1 = 3,p0 = 2.
By doing this way, you will get the above Gantt chart.
Scheduling table:
AT = Arrival Time, BT = Burst Time, CT = Completion Time, TAT = Turn Around Time As we know, turn around time is the total time between submission of the process and its completion. i.e turn around time = completion time-arrival time. i.e. TAT = CT − AT.
Turn around time of p0 = 12 (12 − 0)
Turn around time of p1 = 13 (13 − 0)
Turn around time of p2 = 14 (14 − 0)
Average turn around time is,
= 13
=13
Hence, the correct answer is 13.