银行家算法实验报告(11)
时间:2025-05-01
时间:2025-05-01
Avaliable[j]=Avaliable[j]-Request[j]; //q[i][j]=Allocation[i][j];
Allocation[i][j]=Allocation[i][j]+Request[j]; //z[i][j]=Need[i][j];
Need[i][j]=Need[i][j]-Request[j]; } return 1; }
int safe()//安全性算法 {
int i,d,k=0,m,h,s,apply,Finish[100]={0}; int j; int flag=0; for(i=0;i<N;i++) Work[i]=Avaliable[i];
cout<<endl<<" 安全性检查 "<<endl; cout<<" Work Need Allocation Work+Allocation Finish"<<endl;
cout<<"进程名 "; for(h=0;h<4;h++){ for(s=0;s<N;s++) cout<<name[s]<<" "; cout<<" "; }
cout<<endl;
上一篇:研发部-上年度工作总结
下一篇:五笔拆字规则和技巧