Answer:
Check the explanation
Step-by-step explanation:
Hey, its a very good question to understand the scheduling algorithms. For simplicity purposes, I had divided the solution into parts. So, le's start.
Remember this formula:
TURNAROUND TIME = (TIME AT WHICH JOB COMPLETED - TIME OF ARRIVAL)
PART ONE: GIVEN DATA:
Process Execution Time Time Arrival
A 10 0
B 6 0
C 2 0
D 4 3
E 8 3
PART TWO: SOLUTION
1. FCFS:
Turnaround Time: The amount of time taken to complete a process from the time of arrival
Calculating the turnaround time of each process:
At t=0, 3 processes A, B and C arrived. Since priority is not given, so they can execute in any order.
At t=3, 2 Processes D and E arrived. Their priority is also not given, so they can also execute in any order.
However, for solving this part we will assume the execution lexicographically where the time of arrival is the same.
In FCFS they are pushed in Queue. So A, B, and C will execute first and then D and E will execute.
Turnaround time for :A = 10 (It executes first), B= 10+6=16 , C = 10+6+2 = 18
D = (18+4) - 3 = 19 (Since they arrived at t=3), E = (22 + 8) - 3 = 27
Mean Turnaround Time = Total Turnaround time / N
= (10 + 16 + 18 + 19 + 27)/5
= 90/5
= 18
1. SJB(Shortest Job First):
At t=0, A,B and C all arrived together. now the job having shortest execution time will be executed.
C will execute first.
Turnaround time for: C = (2-0), (0 to 2) = 2
B= 12 - 0 = 12
D = 7 - 3 = 4
E = 20 -3 = 17
A = 30 - 0 = 30
Mean turnaround time = (2 + 12 + 4 + 17 + 30)/5
= 65/5
= 13