p1 ,p2, p3 are three process
Arrival time of p1 is 1 so we made to run p1 at time 1
now p1 is run for 2 units ( upto 3) new process arrived with less B.T ,so switch happens to p2 ----- (1)
p2 run till completion since there are no shorter jobs available ,then switch happens to p1---- (2)
again p1 is run since it has burst time ( 18 ) < burst time of p3 ( 30 )
completion of p1, switch happens to p3 run till completion. ----- (3)