663 views
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 ________.

@ 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.
by

I think adding a line that x >25  can remove the ambiguity
humm good idea, though i change the range of answers , now it is  5-45 so take both 5 and 45 values.
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
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.

@arjun sir ,,bikram sir why 5 cant be a ans
@asu and @tarun corrected.