LOOK


Look disk scheduling is another type of disk scheduling algorithm. Look scheduling is an enhanced version of SCAN disk scheduling. Look disk scheduling is the same as SCAN disk scheduling, but in this scheduling, instead of going till the last track, we go till the last request and then change the direction.


Advantages:


Disadvantages:

Example:

Steps to Implement Algorithm:

  1. Let Request array represents an array storing indexes of tracks that have been requested in ascending order of their time of arrival. 'head' is the position of disk head.
  2. The initial direction in which head is moving is given and it services in the same direction.
  3. The head services all the requests one by one in the direction head is moving.
  4. The head continues to move in the same direction until all the request in this direction are finished.
  5. While moving in this direction calculate the absolute distance of the track from the head.
  6. Increment the total seek count with this distance.
  7. Currently serviced track position now becomes the new head position.

Time Complexity: O ( N * logN )   Auxiliary Space: O ( N )

Simulate