assalammualaikum hi everyone so this is sjf okay the pre-emptive version called as R T showed us remaining time for us to illustrate how it works let us consider the timeline okay let us consider the timeline at zero we only have p 0 okay there are no other processes arrived yet and then at 2 you have P 1 coming in and then at 5 you have P 2 followed by at 7 we have P 3 and finally and finally we have p4 coming in at 10 so this is a timeline so we all gunshot this is our gun shot at 0 we only have p 0 okay and then add 2 here p 0 has two remaining of 14 after as a shooting for two millisecond and the next one in the timeline that we have here is P 1 at this point P 1 first time is 10 and p 0 is 14 so which one is shorter so definitely P 1 is shorter so therefore what we do what we do here is we will pre MP 0 and we put in P 1 so meaning that this p 0 K will be Q back here okay at 2 because it's still happy meaning time of 14 and then at 5 okay at 5 what happens that at five p 1 after as accutane for 3 millisecond it's still happy meaning of 7 okay it still having me of seven so Pichu we have speech you'll hear p2 has dreamed in a second when you compare with the remaining time of P 1 then P 2 is shorter so therefore we will pre end this P 1 and we put in T 2 here and then at 7 okay so meaning that at 5 at 5 here P 1 will be back here ok so at 7 at 7 we have P a tree coming in and when you compare this time P 2 has remaining of one but P 3 is 8 so which one is shorter so P 2 is shorter so therefore this P 2 will finish at hey this P 2 will finish at 8 so we are done with this P 2 so what happened next okay at a you only have p0 T 1 and T 3 left since before is not arrived yet so between this tree you need to compare the remaining time or the first time that they have so at this point p 0 at this point is 14 P 1 is 7 and you have P 3 of a so which one is shorter so P 1 is shorter and then at 10 at 10 you have people coming in at this point P 1 has remaining of 5 right and then 5 compared to the rest it is compared to P 4 which is 12 then P 1 will continue until completion so this P 1 okay from 8 P 1 will finish at 15 okay this P 1 will finish at 15 so we have finish with B 1 then we have p 0 P 3 and finally people so the next one shorter will be P 3 okay so this P 3 will finish at p3 is a so it will finish at 23 okay and then after that we are finished with p3 the next one we have will be p4 okay could be peaceful and p4 is P 4 is 12 so suppose in it will complete it at 35 here at 35 and finally just please add in p0 which will end at 49