Question
Consider the following five disk access requests of the form (request id, cylinder number) that are present in the disk scheduler queue at a given time.
Assume the head is positioned at cylinder 100. The scheduler follows Shortest Seek Time First scheduling to service the requests.
Which one of the following statements is FALSE?
Official answer and solution
- Official answer
- B
- From
- Official GATE 2020 answer key
Solution
Simulate the Shortest Seek Time First (SSTF) disk scheduling algorithm from starting cylinder 100.
Requests: . Initial head position: 100.
Step-by-step SSTF simulation:
- From 100:
- Distance to
- Distance to , , ,
- Minimum is . Head moves to 110.
- From 110:
- Distance to
- Distance to , ,
- Minimum is . Head moves to 115.
- From 115:
- Distance to
- Distance to ,
- Minimum is . Head moves to 85.
- From 85:
- Distance to
- Distance to
- Minimum is . Head moves to 30.
- From 30:
- Only remains. Head moves to 155.
Service sequence:
Evaluate the statements:
- A: 'T is serviced before P' is TRUE (T is 2nd, P is 5th).
- B: 'Q is serviced after S, but before T' is FALSE (Q is 3rd, while S is 4th; so Q is serviced before S).
- C: 'The head reverses its direction of movement between servicing of Q and P' is TRUE (from T to Q to S, direction is decreasing; from S to P, direction is increasing).
- D: 'R is serviced before P' is TRUE (R is 1st, P is 5th).
B
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2020 Computer Science and Information Technology (CS)
- Question
- 45 of 65, printed as CS Q.35
- 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.