Explanation
Given Data:
Total cylinders = 1000 (numbered from 0 to 999)
Initial head position = 345
Initial direction of head = Towards track 0 (decreasing order)
Request queue (in FIFO order) = [123,874,692,475,105,376]
1. FIFO (First-In, First-Out) Scheduling
In FIFO, requests are serviced exactly in the order they arrive in the queue:
Path: 345→123→874→692→475→105→376
Step-by-Step Head Movements Calculation:
From 345 to 123: ∣123−345∣=222
From 123 to 874: ∣874−123∣=751
From 874 to 692: ∣692−874∣=182
From 692 to 475: ∣475−692∣=217
From 475 to 105: ∣105−475∣=370
From 105 to 376: ∣376−105∣=271
Total FIFO Movements=222+751+182+217+370+271=2013
2. SCAN (Elevator) Scheduling
In the SCAN algorithm, the disk head moves in a particular direction (towards 0 in this case), servicing all pending requests along the path until it reaches the end (0). Then, it reverses direction and moves toward the other end (999), servicing the remaining requests.
Pending Requests: 105,123,376,475,692,874
Initial Position: 345 (moving down towards 0)
Path Traveled:
Moving Downwards: The head services 123 then 105, and continues until it hits the boundary 0.
Reversing Direction: The head shifts towards 999 and services the remaining pending requests in ascending order: 376→475→692→874.
Path: 345→123→105→0→376→475→692→874
Step-by-Step Head Movements Calculation:
Total SCAN Movements=345+874=1298
Final Answer: