Welcome![Sign In][Sign Up]
Location:
Downloads SourceCode Other Disk Tools
Title: NStepSCAN Download
 Description: #include "stdafx.h" #include "stdlib.h" int L,P int a[20] int flag //访问位 typedef struct TASK { int requrie int io } TASK TASK T[50][50] TASK N[50] int diskway //当前磁道 void iodowith() void init() { int i,j for(i=0 i<20 i++) { for(j=0 j<20 j++) { T[i][j].requrie=-1 } } for(i=0 i<L i++) { for(j=0 j<P j++) { T[i][j].requrie=rand() 200 T[i][j].io=rand() 2 } } } void output() { printf("磁盘访问的初始顺序是:\n") for(int i=0 i<L i++) { printf("第 d组是:\n",i+1) for(int j=0 j<P j++) { printf(" d d\t",T[i][j].requrie,T[i][j].io) } printf("\n") } } void sort_btos(TASK x[],int n) { int i,j,k TASK t for(i=0 i<n-1 i++) { k=i for(j=i+1 j<n j++) if(x[j].requrie>x[k].requrie) k=j if(k!=i) { t=x[i] x[i]=x[k] x[k]=t } } } void sort_stob(TASK x[],int n) { int i,j,k TASK t fo
 To Search:
File list (Check if you may need any files):
NStepSCAN.txt
    

CodeBus www.codebus.net