# GATE2007-IT-82

2.1k views

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?

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
0
unable to understand the que???

what is actually doing in this que???? plz explain in simple way
2
read question once again..here after "every" request means after "each" request.
0
truck number 180 :P

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
0
whats the difference between B and D ...

in these both have 180---181---178---170---185---then remain in same direct ...?
1
Read it clearly once :) There is differnce :D
0
B) after 185 ,201 and D) 200 then both will be in same direction then why only B)
14

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.

got it?

0
thanks for reply ,... but not getting exactly

how at 200 at same direction or 201 is not ... :(
16

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 "

1
o, sorry, i did mistake, ...( i went direct 170 before 185 , 7<8 , from 178 ..  :P)

Thanks a  lot .... :)
1
Awesome explanation:-)
0

but in option A it is also changing its directions

184->178

0
in option a)from 181 ,184 and 178 have same difference so in tie direction will not change ...

## Related questions

1
8.7k views
The head of a hard disk serves requests following the shortest seek time first (SSTF) policy. What is the maximum cardinality of the request set, so that the head changes its direction after servicing every request if the total number of tracks are $2048$ and the head can start from any track? $9$ $10$ $11$ $12$
A demand paging system takes $100$ time units to service a page fault and $300$ time units to replace a dirty page. Memory access time is $1$ time unit. The probability of a page fault is $p$. In case of a page fault, the probability of page being dirty is also $p$. It is observed that the average access time is $3$ time units. Then the value of $p$ is $0.194$ $0.233$ $0.514$ $0.981$
A hard disk system has the following parameters : Number of tracks $= 500$ Number of sectors/track $= 100$ Number of bytes /sector $= 500$ Time taken by the head to move from one track to adjacent track $= 1 \ ms$ Rotation speed $= 600 \ rpm$. What is the average time taken for transferring $250$ bytes from the disk ? $300.5 \ ms$ $255.5 \ ms$ $255 \ ms$ $300 \ ms$