let us assume that the SCAN algorithm is currently going from a lower track number to a higher track number (like the C-SCAN is doing). For both methods, one takes the difference in magnitude (i.e. absolute value) between the next track request and the current track. Seek 1: 50 − 35 = 15 Seek 2: 75 − 50 = 25 Seek 3: 100 − 75 = 25 At this point both have reached the highest (end) track request. SCAN will just reverse direction and service the next closest disk request (in this example, 20) and C-SCAN will always go back to track 0 and start going to higher track requests. Seek 4 (SCAN): 20 − 100 = 80 Seek 5 (SCAN): 10 − 20 = 10 Total (SCAN): 155 Average (SCAN): 155 ÷ 5 = 31 Seek 4 (C-SCAN): 0 − 100 = 0 head movement as cylinders are treated as a circular list (C-SCAN always goes back to the first track) Seek 5 (C-SCAN): 10 − 0 = 10 Seek 6 (C-SCAN): 20 − 10 = 10 Total (C-SCAN): 85 Average (C-SCAN): 85 ÷ 5 = 17 Even though six seeks were performed using the C-SCAN algorithm, only five I/Os were actually done. Analysis For both versions of the elevator algorithm, the arm movement is less than twice the number of total cylinders and produces a smaller variance in response time. The algorithm is also relatively simple. The elevator algorithm is not always better than shortest seek first, which is slightly closer to optimal, but can result in high variance in response time and even in starvation when new requests continually get serviced prior to existing requests. Anti-starvation techniques can be applied to the shortest seek time first algorithm to guarantee a maximum response time. See also FCFS Shortest seek time first References Disk scheduling algorithms Sorting algorithms