### 1. Shortest Job First (SJF - Non-preemptive since all arrive at t=0):
Order of execution based on shortest burst time: P3(2)→P4(4)→P2(7)→P1(8)
Completion Times (CT):
CT(P3)=2
CT(P4)=2+4=6
CT(P2)=6+7=13
CT(P1)=13+8=21
Turnaround Time (TAT=CT−AT=CT):
Average TATSJF=42+6+13+21=442=10.5 ms
### 2. Round Robin (RR) with time quantum q=4 ms:
Queue order: P1,P2,P3,P4
0−4: P1 executes for 4 ms (remaining: 4)
4−8: P2 executes for 4 ms (remaining: 3)
8−10: P3 executes for 2 ms (completes at t=10)
10−14: P4 executes for 4 ms (completes at t=14)
14−18: P1 executes for 4 ms (completes at t=18)
18−21: P2 executes for 3 ms (completes at t=21)
Completion Times for RR:
CT(P1)=18
CT(P2)=21
CT(P3)=10
CT(P4)=14
Average TATRR=418+21+10+14=463=15.75 ms
### 3. Absolute Difference:
∣TATSJF−TATRR∣=∣10.5−15.75∣=5.25 ms