Consider a disk with cylinders numbered 0 through 199. Its pending I/O…

2025

Consider a disk with cylinders numbered 0 through 199. Its pending I/O requests are for cylinders 45, 81, 185, 33, 175, 99, 150, and 77. The disk head starts at cylinder 58 and initially moves toward higher-numbered cylinders. Using C-SCAN, what is the total head movement in cylinders, counting the wrap from cylinder 199 to cylinder 0?

Answer: D. 385ConceptC-SCAN services requests while moving in one direction. After reaching the last cylinder, the head wraps to the first cylinder and then continues in…

  1. A.

    327

  2. B.

    307

  3. C.

    525

  4. D.

    385

Attempted by 184 students.

Show answer & explanation

Correct answer: D

Concept

C-SCAN services requests while moving in one direction. After reaching the last cylinder, the head wraps to the first cylinder and then continues in the same direction.

When total head movement includes the wrap, add every distance physically travelled: service-to-service movement, travel to the disk end, the end-to-start wrap, and the remaining movement after the wrap.

Application

  1. Sort the requests: 33, 45, 77, 81, 99, 150, 175, 185.

  2. Starting at 58 and moving right, service 77, 81, 99, 150, 175, and 185. The movement from 58 to 185 is 185 − 58 = 127 cylinders.

  3. Continue from 185 to the last cylinder, 199: 199 − 185 = 14 cylinders.

  4. Wrap from 199 to 0: 199 cylinders.

  5. After the wrap, service 33 and 45. The movement from 0 to 45 is 45 cylinders.

  6. Add the segments: 127 + 14 + 199 + 45 = 385 cylinders.

Cross-check

The same path can be grouped into three monotonic spans: 58 to 199 gives 141, the wrap gives 199, and 0 to 45 gives 45. Thus 141 + 199 + 45 = 385.

Result

The total head movement is 385 cylinders.

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

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…