Suppose the following disk request sequence (track numbers) for a disk with…

2015

Suppose the following disk request sequence (track numbers) for a disk with 100 tracks is given: 45, 20, 90, 10, 50, 60, 80, 25, 70. Assume that the initial position of the R/W head is on track 50. The additional distance that will be traversed by the R/W head when the Shortest Seek Time First (SSTF) algorithm is used compared to the SCAN (Elevator) algorithm (assuming that SCAN algorithm moves towards 100 when it starts execution) is _________ tracks

Attempted by 85 students.

Show answer & explanation

Correct answer: 10

SCAN (moving towards higher-numbered tracks first): Start at track 50, move up to the end (track 100), then reverse and serve remaining requests down to the lowest requested track (track 10).

  • Movement from 50 to 100 = 100 - 50 = 50 tracks.

  • Movement from 100 down to 10 = 100 - 10 = 90 tracks.

Total SCAN movement = 50 + 90 = 140 tracks.

SSTF (Shortest Seek Time First) sequence and movements:

Serve requests in order of nearest next request from the current head position. Starting at 50 (there is a request at 50, which is served immediately with 0 movement), the chosen sequence and distances are:

  • 50 -> 45 : 5 tracks

  • 45 -> 60 : 15 tracks

  • 60 -> 70 : 10 tracks

  • 70 -> 80 : 10 tracks

  • 80 -> 90 : 10 tracks

  • 90 -> 25 : 65 tracks

  • 25 -> 20 : 5 tracks

  • 20 -> 10 : 10 tracks

Total SSTF movement = 5 + 15 + 10 + 10 + 10 + 65 + 5 + 10 = 130 tracks.

Therefore, the additional distance traversed by the R/W head when using SSTF compared to SCAN = 140 - 130 = 10 tracks.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir