edited by
5,894 views
31 votes
31 votes

The head of a hard disk serves requests following the shortest seek time first $\textsf{(SSTF)}$ policy. The head is initially positioned at track number $180$.

Which of the request sets will cause the head to change its direction after servicing every request assuming that the head does not change direction if there is a tie in $\textsf{SSTF}$ and all the requests arrive before the servicing starts?

  1. $11, 139, 170, 178, 181, 184, 201, 265$
  2. $10, 138, 170, 178, 181, 185, 201, 265$
  3. $10, 139, 169, 178, 181, 184, 201, 265$
  4. $10, 138, 170, 178, 181, 185, 200, 265$
edited by

1 Answer

Best answer
31 votes
31 votes

It should be (B).

When the head starts from $180$. It seeks the nearest track which is $181$. Then, from $181$ it seeks the nearest one which is $178$ and $184$. But the difference in both from $181$ is same and as given in the question. If there is a tie then the head wont change its direction, and therefore to change the direction we need to consider $178$. and thus we can eliminate option (A) and (C).



Coming next to option (B) and (D).

Following the above procedure you'll see that option (D) is eliminated on similar ground. And thus you can say option (B) is correct.

edited by
Answer:

Related questions