Consider a disk sequence with 100 cylinders. The request to access the…

2017

Consider a disk sequence with 100 cylinders. The request to access the cylinder occur in the 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 2 ms to move from one cylinder to adjacent one and shortest seek time first policy is used?

  1. A.

    190

  2. B.

    238

  3. C.

    233

  4. D.

    276

Attempted by 64 students.

Show answer & explanation

Correct answer: B

Under the Shortest Seek Time First (SSTF) policy, the disk arm services the request closest to its current position.

From 50:

Nearest = 34 → movement = |50 − 34| = 16

From 34:

Nearest = 20 → |34 − 20| = 14

From 20:

Nearest = 19 → |20 − 19| = 1

From 19:

Nearest = 15 → |19 − 15| = 4

From 15:

Nearest = 10 → |15 − 10| = 5

From 10:

Nearest = 7 → |10 − 7| = 3

From 7:

Nearest = 6 → |7 − 6| = 1

From 6:

Nearest = 4 → |6 − 4| = 2

From 4:

Nearest = 2 → |4 − 2| = 2

From 2:

Remaining = 73 → |2 − 73| = 71

Total distance traveled = 16+14+1+4+5+3+1+2+2+71=119

Time taken = 119cylinders * 2 ms/cylinder = 238 ms.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro