GateAI
CPU and I/O Scheduling

GATE CSE 2015 Set 1 · Q30

NAT2 marksMedium

Time

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.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 10

CPU and I/O Scheduling

Given requests: 45,20,90,10,50,60,80,25,7045, 20, 90, 10, 50, 60, 80, 25, 70 Initial head position: 5050

1. SSTF (Shortest Seek Time First):

  • From 5050, request 5050 is serviced first (distance =0= 0).

  • From 5050, the closest pending request is 4545 (distance =∣50−45∣=5= |50-45| = 5).

  • From 4545, candidates are 2525 (distance 2020) and 6060 (distance 1515). The head moves to 6060 (distance =15= 15).

  • From 6060, closest is 7070 (distance =10= 10).

  • From 7070, closest is 8080 (distance =10= 10).

  • From 8080, closest is 9090 (distance =10= 10).

  • From 9090, remaining requests are 25,20,1025, 20, 10. Head moves to 2525 (distance =∣90−25∣=65= |90-25| = 65).

  • From 2525, moves to 2020 (distance =5= 5).

  • From 2020, moves to 1010 (distance =10= 10).

Total SSTF seek distance:

TotalSSTF=0+5+15+10+10+10+65+5+10=130 tracks\text{Total}_{\text{SSTF}} = 0 + 5 + 15 + 10 + 10 + 10 + 65 + 5 + 10 = 130\text{ tracks}

2. SCAN (Elevator) moving towards 100:

  • Head starts at 5050 and moves upwards servicing 50,60,70,80,9050, 60, 70, 80, 90.

  • Distance moving upwards to the highest request (9090): ∣90−50∣=40|90 - 50| = 40 tracks.

  • Head then reverses direction and services remaining requests downward: 45,25,20,1045, 25, 20, 10.

  • Distance moving downwards from 9090 to 1010: ∣90−10∣=80|90 - 10| = 80 tracks.

Total SCAN seek distance:

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

3. Additional distance:

Additional distance=TotalSSTF−TotalSCAN=130−120=10 tracks\text{Additional distance} = \text{Total}_{\text{SSTF}} - \text{Total}_{\text{SCAN}} = 130 - 120 = 10\text{ tracks}

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This CPU and I/O Scheduling previous year question is Q30 of the GATE CSE 2015 Set 1 paper. Find more GATE CSE PYQs on CPU and I/O Scheduling in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related CPU and I/O Scheduling PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

CPU and I/O Scheduling in GATE CSE

CPU and I/O Scheduling has 25 GATE CSE PYQs across 22 papers from 2011 to 2026. 10 of them are 2-mark NAT questions like this one, and GATE CSE 2015 Set 1 has 2.

How GATE tests CPU and I/O Scheduling

More from GATE CSE 2015 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 1 · Q30 · NAT

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.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.