Question
Suppose the following disk request sequence (track numbers) for a disk with tracks is given: . Assume that the initial position of the R/W head is on track . 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 when it starts execution) is _____ tracks.
Official answer and solution
- Official answer
- 10
- From
- Official GATE 2015 answer key
Solution
Simulate the head movement path under SSTF and SCAN algorithms and find their difference.
Given requests: .
Initial head position: track .
Note that request is serviced immediately with distance .
- SSTF (Shortest Seek Time First):
- From , remaining requests are .
- Closest to is (distance ).
- From , closest is (distance , whereas ).
- From , closest is (distance ).
- From , closest is (distance ).
- From , closest is (distance ).
- From , the head must reverse and service remaining left requests: .
Distance from to . - Total SSTF head movement:
- SCAN (Elevator) moving towards track 100:
- Head starts at and moves upward to track :
Distance , servicing . - Head reverses at track and moves downward to the lowest request (track ):
Distance , servicing . - Total SCAN head movement:
- Difference:
The additional distance is tracks.
10
Assuming LOOK instead of SCAN (LOOK reverses at 90 instead of traveling to boundary 100).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 1
- Question
- 40 of 65, printed as CS Q.30
- 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.