#include <stdio.h> #include <stdlib.h> int main() { int queue[20], n, head, i, j, seek_time = 0, diff, max, min, temp, range; float avg_seek_time; printf("Enter the number of requests: "); scanf("%d", &n); printf("Enter the queue of disk requests: "); for(i = 0; i < n; i++) scanf("%d", &queue[i]); printf("Enter the initial head position: "); scanf("%d", &head); queue[n] = head; n++; for(i = 0; i < n; i++) { for(j = i; j < n; j++) { if(queue[i] > queue[j]) { temp = queue[i]; queue[i] = queue[j]; ...
Comments
Post a Comment