SSTF Algorithm
SSTF
Basic idea is the tracks which are closer to current disk head position should be serviced first in order to minimise the seek operations.
Algorithm
1.Let Request array represents an array storing indexes of tracks that have been requested.
‘head’ is the position of disk head.
2.Find the positive distance of all tracks in the request array from head.
3.Find a track from requested array which has not been accessed/serviced yet and has
minimum distance from head.
4.Increment the total seek count with this distance.
5.Currently serviced track position now becomes the new head position.
6.Go to step 2 until all tracks in request array have not been serviced.