Shortest Seek Time First (SSTF) Disk Scheduling
Shortest Seek Time First (SSTF) Disk Scheduling Aim To simulate the SSTF disk scheduling algorithm and compute the total head movement , displaying Step, From, To, Movement . Theory Shortest Seek Time First (SSTF) selects the disk request that is closest to the current head position . Minimizes immediate seek time Improves performance compared to FCFS May cause starvation for far-away requests Algorithm Read number of disk requests. Read request queue. Read initial head position. Mark all requests as unvisited. From current head: Find request with minimum absolute distance Move head to that request Add movement to total Mark request visited Repeat until all requests are serviced. Program: SSTF Disk Scheduling (C) # include <stdio.h> # include <stdlib.h> int main () { int n, head, total = 0 ; printf ( "Enter number of requests: " ); scanf ( "%d" , &n); int req[n], v...