All mock tests are FREE till 31 December — register to save your progress

A moving-head disk has 200 tracks, numbered 0 to 199. The head has just finished a request at track 125 and is currently at track 143 (so it is moving in the direction of increasing track numbers). The pending request queue, in FIFO arrival order, is: 86, 147, 91, 177, 94, 150, 102, 175, 130. What is the total head movement (in cylinders) to service all these requests using the SCAN algorithm?

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

Show answer & explanation

Correct answer: B. 169 cylinders

Explanation

Since the head moved from 125 to 143, it is travelling upward, so SCAN first services the requests above 143 in increasing order — 147, 150, 175, 177 — then (true SCAN) continues to the disk's last track 199 before reversing, and finally services the requests below 143 in decreasing order — 130, 102, 94, 91, 86. The movement is: 143→147 (4) + 147→150 (3) + 150→175 (25) + 175→177 (2) + 177→199 (22) + 199→130 (69) + 130→102 (28) + 102→94 (8) + 94→91 (3) + 91→86 (5). Summing: 4+3+25+2+22+69+28+8+3+5 = 169 cylinders, confirming option (ii).

More Database Management Systems questions