The head of a hard disk serves requests following the shortest seek time first (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 SSTF and all the requests arrive before the servicing starts?
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.
head to change its direction after servicing every request
this is the important line here
means we have to get the line zigzag manner
Here if after 185 , 200 comes direction will not change , as per question "head does not change direction if there is a tie"
but 185 to 201 head moves 185-----170-----------201 , so, it will again change its direction.
Draw diagram for each of the options , u will definitely get ans
see B, D I have drawn
for (D) 185 to 200 will not change direction because it is given in question " "head does not change direction if there is a tie""
but we need "head to change its direction after servicing every request "
so, (B) answer
but in option A it is also changing its directions