Suppose that a disk drive has 5,000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order,is:
86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130
starting from the current head position, what is the total distance (in cylinders)that the disk arm moves to satisfy all the pending requests for each of the SCAN disk-scheduling algorithms?
Compile the code : gcc scan.c
Once the compilation is done, the a.out file created can be executed.