Anonymous user menu

Suppose the following disk request sequence (track numbers) for a disk with 100 tracks : GATE-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..

Answer

 

ANS-10

​EXP-
Given a disk with 100 tracks

And Sequence 45, 20, 90, 10, 50, 60, 80, 25, 70.

Initial position of the R/W head is on track 50.

In SSTF, requests are served as following

Next Served     Distance Traveled

50                       0

45                       5

60                      15

70                      10

80                      10

90                      10

25                      65

20                       5

10                      10

-----------------------------------

Total Dist =      130

In SCAN, requests are served as following

Next Served       Distance Traveled

50                      0

60                     10

70                     10

80                     10

90                     10

45                     45

25                      20

20                     5

10                    10

-----------------------------------

Total Dist =   120

Extra Distance traveled in SSTF = 130 - 120 = 10(ANS)
 

1Comment
Mohit Lalwani @monty12
11 Feb 2016 06:39 pm

above answer is correct for 1-100 and when question says towards 99 then below is correct.. . first image for scan and second is SSTF

 

 

For scan....  ..