Skip to content
Official PYQ · 2015

GATE CS 2015 Set 1 Q30 — I/O Scheduling

Explain with AI
Suppose the following disk request sequence (track numbers) for a disk with 100100 tracks is given:

45,20,90,10,50,60,80,25,70.45, 20, 90, 10, 50, 60, 80, 25, 70.

Assume that the initial position of the R/W head is on track 5050. 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 100100 when it starts execution) is________________tracks.
View worked solution

Answer: 10

To find the additional distance traversed by the R/W head using the SSTF algorithm compared to the SCAN algorithm, we calculate the total head movements for both.

1. Shortest Seek Time First (SSTF) Algorithm:

Starting at track 5050, the head always moves to the nearest pending request:

  • 50→4550 \to 45 (distance: ∣45−50∣=5|45 - 50| = 5)
  • 45→6045 \to 60 (distance: ∣60−45∣=15|60 - 45| = 15)
  • 60→70→80→9060 \to 70 \to 80 \to 90 (distance: ∣90−60∣=30|90 - 60| = 30)
  • 90→2590 \to 25 (distance: ∣25−90∣=65|25 - 90| = 65)
  • 25→20→1025 \to 20 \to 10 (distance: ∣10−25∣=15|10 - 25| = 15)

Total SSTF Distance=5+15+30+65+15=130 tracks\text{Total SSTF Distance} = 5 + 15 + 30 + 65 + 15 = 130 \text{ tracks}

2. SCAN (LOOK) Algorithm:

Starting at 5050 and moving towards 100100, the head services requests in that direction up to the last request (9090), then reverses direction to service the remaining requests down to 1010:

  • 50→60→70→80→9050 \to 60 \to 70 \to 80 \to 90 (distance: ∣90−50∣=40|90 - 50| = 40)
  • 90→45→25→20→1090 \to 45 \to 25 \to 20 \to 10 (distance: ∣10−90∣=80|10 - 90| = 80)

Total SCAN Distance=40+80=120 tracks\text{Total SCAN Distance} = 40 + 80 = 120 \text{ tracks}

3. Difference:

Additional Distance=130−120=10 tracks\text{Additional Distance} = 130 - 120 = 10 \text{ tracks}

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore I/O Scheduling questions