Program 10
Program 10
Program:
#include <stdio.h>
#include <stdlib.h>
int main() {
float avg;
scanf("%d", &max);
scanf("%d", &head);
int pos[] = {90, 120, 35, 122, 38, 128, 65, 68};
n = sizeof(pos) / sizeof(pos[0]);
printf("\n");
temp = pos[i];
queue1[temp1] = temp;
temp1++;
} else {
queue2[temp2] = temp;
temp2++;
temp = queue1[i];
queue1[i] = queue1[j];
queue1[j] = temp;
temp = queue2[i];
queue2[i] = queue2[j];
queue2[j] = temp;
queue[index++] = queue1[i];
}
queue[index++] = queue2[i];
seek += diff;
printf("Disk head moves from %d to %d with seek %d\n", queue[j], queue[j + 1], diff);
return 0;
OUTPUT: