All mock tests are FREE till 31 December — register to save your progress
Unit 4 · Database Management Systems Paper 2 CS · November 2020

Consider a disk system having 60 cylinders. Disk requests are received by the disk drive for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. Assuming the disk head is currently at cylinder 20, what is the time taken to satisfy all the requests if it takes 2 milliseconds to move from one cylinder to an adjacent one and the Shortest Seek Time First (SSTF) algorithm is used?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: C. 120 milliseconds

Explanation

Starting from cylinder 20 with pending requests {10, 22, 20, 2, 40, 6, 38}, SSTF always services whichever pending request is nearest to the head's current position. The request for cylinder 20 needs 0 movement (head is already there); the nearest remaining request is then 22 (distance 2), then from 22 the nearest is 10 (distance 12), then 6 (distance 4), then 2 (distance 4), then from 2 the nearest remaining is 38 (distance 36), and finally 40 (distance 2). The movement sequence is 20→22→10→6→2→38→40, totalling 2+12+4+4+36+2 = 60 cylinders. At 2 ms per cylinder, total time = 60 × 2 = 120 ms, matching option (iii).

More Database Management Systems questions