GATE 2016 CS (CS1) – Question 58
Consider a disk queue with requests for I/O to blocks on cylinders 47, 38, 121, 191, 87, 11, 92, 10. The C-LOOK scheduling algorithm is used. The head is initially at cylinder number 63, moving towards larger cylinder numbers on its servicing pass. The cylinders are numbered from 0 to 199. The total head movement (in number of cylinders) incurred while servicing these requests is ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 346
Explanation
Requests: 47, 38, 121, 191, 87, 11, 92, 10. Head at 63 moving towards larger cylinders. C-LOOK goes up to the highest request, jumps back to the lowest request, and continues upward.
1. **Upward sweep from 63:** serve 87, 92, 121, 191. Movement $=191-63=128$.
2. **Jump back** to the lowest pending request, 10: movement $=191-10=181$.
3. **Upward again:** serve 10, 11, 38, 47. Movement $=47-10=37$.
$$\text{Total}=128+181+37=\mathbf{346}\text{ cylinders}.$$