UGC-NET | UGC NET CS 2018 July – II | Question 59

Consider the following three processes with the arrival time and CPU burst time given in milliseconds:

Process       Arrival Time        Burst Time
P1     0                  7
P2     1                  4
P3     2                  8

The Gantt Chart for preemptive SJF scheduling algorithm is _________.
(A)
(B)
(C)
(D)


Answer: (B)

Explanation: P1 arrive at 0 it will be served by CPU for 1 unit. After 1 unit P2 arrived ans it is shortest So it will execute for 4 unit, after its execution There are 2 processes out of which P1 is shortest so it will execute for 6 unit after its execution P1 will execute for 8 unit.
Gantt chart for preemptive SJF scheduling algorithm is:

So, option (B) is correct.


Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.