**Solution:**

**Q. 1 Answer**

P0
P4
P3
P2
P1
P5
0
2
5
9
10
16
24

Total Waiting Time = 0+2+5+1+10+16 = 34 Seconds

Average Waiting Time = 34/6 = 5.66 Seconds

**Q.2 Answer:**

**Solution 1:**

P0
P1
P3
P0
P2
P3
P2
P3
P2
P2
0
8
16
24
31
39
47
55
57
65
66

Turnaround time= Exit Time- Arrival Time

Turnaround time for P0 = 31-0 = 31

P1 = 16-4 = 12

P2 = 66-18 = 48

P3 = 57- 5= 52

Total Turnaround Time = 39+12+48+52 = 143

Average Turnaround Time = 143 / 4 =35.75 millisecond

Waiting Time= Turnaround Time- Burst Time

Waiting time for P0 = 31-15 = 16

P1 = 12-8 = 4

P2 = 48-25 = 23

P3 = 52-18 = 34

Total Waiting Time = 16+4+23+34 =77

Average Waiting Time = 77 / 4 =19.25 millisecond

**Solution 2:**

P0
P1
P3
P2
P0
P3
P2
P3
P2
P2
0
8
16
24
31
39
47
55
57
65
66

Turnaround time= Exit Time- Arrival Time

Turnaround time for P0 = 39-0 = 39

P1 = 16-4 = 12

P2 = 66-18 = 48

P3 = 57- 5= 52

Total Turnaround Time = 39+12+48+52 = 151

Average Turnaround Time = 151 / 4 =37.75 millisecond

Waiting Time= Turnaround Time- Burst Time

Waiting time for P0 = 39-15 = 24

P1 = 12-8= 4

P2 = 48-25= 23

P3 = 52-18 = 34

Total Waiting Time = 24+0+5+29 = 85

Average Waiting Time = 85 / 4 =21.25 millisecond