Question: algorithm subject Solve using any programming language. Deliver.cpp Only on BlackBoard Problem 1 Assume that a disk scheduler is to handle file data requests A,
algorithm subject
Solve using any programming language. Deliver.cpp Only on BlackBoard Problem 1 Assume that a disk scheduler is to handle file data requests A, B, and C to tracks (or cylinders) 100, 50, and 190, respectively, and that the disk read/write head is initially at track 140. Assume it takes 1 time-unit for the disk to seek (move) a distance of one track. If the file data requests are handled in first-come-first-serve order (A,B,C), then the total seek time is 40+50+140=230 time-units. Suppose the requests are to be serviced in the order which minimizes total seek time instead. The goal is to compute the minimal seek time f({A,B,C), 140) = 190, which can be achieved by the order (C,A,B). Problem 2 You are so lucky in 2021 and finally you have bought your dream car. You decided to travel to many cities. The car tank capacity is C litres. And each trip will cost x liters of fuel. You can fill the tank when visiting each city. The expected inputs N : number of cities C: Tank capacity A[]: the fuel amount you can fill from each city B[]:the fuel consumption to travel from city i and city i+1 The output The maximum number of cities you can travel
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
