Correct Answer - Option 2 : 15
Shortest remaining time (SRT) is pre-emptive algorithms
Gantt chart:
0 20 30 40 55 70
Process Table:
Process
|
Arrival Time
|
Execution Time (Burst Time)
|
Completion Time |
Turnaround time |
Waiting time |
P1
|
0
|
20
|
|
|
|
P2
|
15
|
25
|
55 |
40 |
15 |
P3
|
30
|
10
|
|
|
|
P4
|
45
|
15
|
|
|
|
Explanation:
Completion time For P2 =55
Turn around time (TAT) = Completion time - Arrival time = 55 -15 = 40
Waiting Time for P2 = TAT-Execution Time = 40- 25 =15
Therefore waiting time P2 is 15 unit: