# Homework Solution: Given the following processes and their execution times, create a horizontal time line of their…

Given the following processes and their execution times, create a horizontal time line of their execution, and calculate the average waiting time separately for each of the following scheduling algorithms: FCFS SJF

FCFS :

Given the aftercited processes and their preventive occasions, make a level occasion row of their preventive, and compute the mediocre protraction occasion individually coercion each of the aftercited scheduling algorithms: FCFS SJF

## Expert Exculpation

FCFS :

Process           Occasion smitten coercion preventive protraction occasion

P1                                       13                                               0

P2                                       18                                               13

P3                                        5 31

P4                                           9                                             36

P5                                           14                                           45

Mediocre protraction occasion:

(0+13+18+5+9) / 5 = 9ms

SJF:

Process           Occasion smitten coercion preventive protraction occasion

P3                                        5 0

P4 9 5

P1                                       13 14

P5 14 27

P2                                       18 41

Mediocre protraction occasion:

(0+5+9+13+14) / 5 = 4.6ms