1. In the first-come-first-served scheduling algorithm:
The scheduling sequence is 1, 2, 3, 4.
At this time, the waiting time of job 1 is 0, and the turnaround time is 2h; The waiting time of process 2 is 2h, and the turnaround time is 3h; The waiting time of process 3 is 3h, and the turnaround time is 3.5h. The waiting time of operation 4 is 3.5h.: The turnaround time is 3.8 hours.
So the average turnaround time is: (2+3+3.5+3.8)/4 = 3.075h..
2. In the shortest job priority scheduling algorithm:
The scheduling order is 4, 3, 2 and 1.
At this time, the waiting time of operation 4 is 0 and the turnaround time is 0.3h; the waiting time of operation 2 is 0.3h and the turnaround time is 0.8h;; The waiting time of operation 3 is 0.8h, and the turnaround time is1.8h.: ; The waiting time of job 4 is1.8h; ; The turnaround time is 3.8 hours.
So the average turnaround time is: (0.3+0.8+1.8+3.8)/4 =1.425h.