edited by
8,385 views
20 votes
20 votes

Consider a disk system with $100$ cylinders. The requests to access the cylinders occur in following sequence:

$4, 34, 10, 7, 19, 73, 2, 15, 6, 20$

Assuming that the head is currently at cylinder $50$, what is the time taken to satisfy all requests if it takes $1\;\text{ms}$ to move from one cylinder to adjacent one and shortest seek time first policy is used?

  1. $95 \;\text{ms}$
  2. $119\;\text{ms}$
  3. $233\;\text{ms}$
  4. $276\;\text{ms}$
edited by

3 Answers

Best answer
27 votes
27 votes

Answer is (B).

$=(50-34)+(34-20)+(20-19)+(19-15)+(15-10)+(10-7)+(7-6)+(6-4)+(4-2)+(73-2)$

$=16+14+1+4+5+3+1+2+2+71$

$=119 \;\text{ms}$

edited by
32 votes
32 votes
Here in case of Shortest seek time first we don't need to do lot of  substraction & addition in this type of questions. It seems like it is necessary to actually calculate  small differences ! It is better to just draw actual movement & Then do computation.

Here sequence is like

50->34->20->19->15->7->4->2->73

So we can calculate like (50-2) + (73-2) = 71+48 = 119.
3 votes
3 votes

The given sequence is
4, 34, 10,7, 19, 73, 2, 15, 6, 20
Arrange the sequence in order
2, 4, 6, 10, 15, 19, 20, 34, 73
 ⇒ 1 ms to move from one cylinder to adjacent one
⇒ (16*1)+(14*1)+(1*1)+(4*1)+(5*1)+(3*1)+(1*1)+(2*1)+(2*1)+(71*1)
⇒ 16+14+1+4+5+3+1+2+2+71
⇒ 119 ms

Answer:

Related questions