In this assignment, you will be writing a program that reads
In this assignment, you will be writing a program that reads
Objective:In this assignment, you will be writing a program that reads a list of disk block accessrequests from stdin or from a file specified on the command line. That list will be usedfour times to run through the following block access algorithms:• First Come, First Served• Shortest Seek Time First• Non-circular LOOK• Circular LOOKYour program will show the total seek values for each algorithm. The first value from thelist is the most recent completed block request, and thus is the current block position forthe device. Your program only needs to work with a maximum of 100 block requests.For the LOOK and C-LOOK algorithms, you start seeking in the positive direction.Hints:• Most of these algorithms are simply two nested loops. The outer loop for each blockrequest. The inner loop to search for the best selection for the next block request.• Make four functions, one for each algorithm. Pass the input data to each function asa parameter. Do not modify your original input arrays.• For each algorithm you will be calculating the difference between two blockaccesses and adding that difference to a total seek accumulator.• Remember that the difference is not just a simple subtraction. The difference mustalways be positive.