GATE 2015 CS (CS1) – Question 56
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.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 10
Explanation
Requests: 45, 20, 90, 10, 50, 60, 80, 25, 70. Head starts at track 50.
**SSTF** (nearest request first)
50 → 45 (5) → 60 (15) → 70 (10) → 80 (10) → 90 (10) → 25 (65) → 20 (5) → 10 (10)
Total $=5+15+10+10+10+65+5+10=130$ tracks.
**SCAN** (moving towards 100 first)
50 → 100 (50 tracks, serving 60, 70, 80, 90 on the way), then reverse down to 10 (90 tracks, serving 45, 25, 20, 10).
Total $=50+90=140$ tracks.
The two schedules differ by $140-130=\mathbf{10}$ tracks.