Open In App

GATE | GATE-CS-2015 (Mock Test) | Question 14

Last Updated : 14 Feb, 2018
Like Article
Like
Save
Share
Report

Consider the situation in which the disk read/write head is currently located at track 45 (of tracks 0-255) and moving in the positive direction. Assume that the following track requests have been made in this order: 40, 67, 11, 240, 87. What is the order in which optimised C-SCAN would service these requests and what is the total seek distance?
(A) 600
(B) 810
(C) 505
(D) 550


Answer: (C)

Explanation: Circular scanning works just like the elevator to some extent. It begins its scan toward the nearest end and works it way all the way to the end of the system. Once it hits the bottom or top it jumps to the other end and moves in the same direction. Keep in mind that the huge jump doesn’t count as a head movement.

Solution:

Disk queue: 40, 67, 11, 240, 87 and disk is currently located at track 45.The order in which optimised C-SCAN would service these requests is shown by the following diagram.
nitika_14

Total seek distance=(67-45)+(87-67)+(240-87)+(255-240)+(255-0)+(11-0)+(40-11)
=22+20+153+15+255+11+29 =505

Option (C) is the correct answer.

Reference:
http://www.cs.iit.edu/~cs561/cs450/disksched/disksched.html
http://iete-elan.ac.in/SolQP/soln/DC14_sol.pdf



This solution is contributed by Nitika Bansal

Quiz of this Question


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads