in GATE retagged by
663 views
1 vote
1 vote
The head of a moving head disk with $100$ tracks numbered $0$ to $99$ is serving a request at track $x$. if the requests of track $25, 76, 43, 10, 67$ are served using $FIFO$ algorithm, then total head movements are $194$. The track $x$ initially served was at ________.
in GATE retagged by
by
663 views

2 Answers

7 votes
7 votes
Best answer
@ Bikram Sir I have a doubt in this.

As given servicing will be done in FIFO order .. And intially head is at X
 all differences will be mod values :

so |x-25| + |76-25|+|76-43|+|43-10|+|67-10|= 194

which is |x--25|=20

so possible ans are 5 and 45 both .

correct me if i am wrong sir.
selected by

4 Comments

I think adding a line that x >25  can remove the ambiguity
2
2
humm good idea, though i change the range of answers , now it is  5-45 so take both 5 and 45 values.
0
0
oh I didn't know that you can specify two discrete values I thought it can only be a range

thats why i didnt suggest it because then it will accept everything in between
0
0
1 vote
1 vote
First assume the head is at 25. Hence total disk head movements will be = (76-25) + (76-43) + (43-10) + (67-10) =174. (As the requests are served in FIFO order).

Now in question the total movement is given as 194. So we need to move extra (194-174)=20 tracks which is only possible if at the begining the head was at (20+25)=45.

3 Comments

@arjun sir ,,bikram sir why 5 cant be a ans
2
2
Answer could be 5 also...please correct it in the answer key
3
3
@asu and @tarun corrected.
0
0
Answer:

Related questions