GATE - 2004 | OS | A disk has 200 tracks (numbered 0 through 199). At a given time, it

GATE - 2004 | OS | A disk has 200 tracks (numbered 0 through 199). At a given time, it
Posted on 22-02-2022

GATE - 2004 [Operating System]

Question:

A disk has 200 tracks (numbered 0 through 199). At a given time, it was servicing the request of reading data from track 120, and at the previous request, service was for track 90. The pending requests (in order of their arrival) are for track numbers. 30 70 115 130 110 80 20 25. How many times will the head change its direction for the disk scheduling policies SSTF(Shortest Seek Time First) and FCFS (First Come Fist Serve)

A

2 and 3

B

3 and 3

C

3 and 4

D

4 and 4

    

Solution:

Option (C) is Correct.

SSTF: (90) 120 115 110 130 80 70 30 25 20
Direction changes at 120, 110, 130.
FCFS: (90) 120 30 70 115 130 110 80 20 25
Direction changes at 120, 30, 130, 20.

Thank You