Question
Suppose a disk has 201 cylinders, numbered from 0 to 200. At some time the disk arm is at cylinder 100, and there is a queue of disk access requests for cylinders 30, 85, 90, 100, 105, 110, 135 and 145. If Shortest-Seek Time First (SSTF) is being used for scheduling the disk access, the request for cylinder 90 is serviced after servicing ____________ number of requests.
Official answer and solution
- Official answer
- 3
- From
- Official GATE 2014 answer key
Solution
Trace the Shortest-Seek Time First (SSTF) disk scheduling algorithm starting from cylinder 100.
Initial head position: cylinder 100.
Pending request queue: .
-
At cylinder 100, distance to request 100 is .
- Service cylinder 100 (1st request serviced).
- Remaining queue: .
- Current head position: 100.
-
Distances from 100:
- Minimum seek distance is 5 (to cylinder 105).
- Service cylinder 105 (2nd request serviced).
- Remaining queue: .
- Current head position: 105.
-
Distances from 105:
- Minimum seek distance is 5 (to cylinder 110).
- Service cylinder 110 (3rd request serviced).
- Remaining queue: .
- Current head position: 110.
-
Distances from 110:
- Minimum seek distance is 20 (to cylinder 90).
- Cylinder 90 is the 4th request serviced.
Therefore, cylinder 90 is serviced after servicing 3 requests (100, 105, and 110).
3
Counting cylinder 90 itself as one of the requests serviced before cylinder 90.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2014 Computer Science and Information Technology (CS) Session 1
- Question
- 29 of 65, printed as CS Q.19
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.