时间片轮转算法介绍(doc 7页).doc

时间片轮转算法介绍(doc 7页).doc

ID:53808558

大小:34.00 KB

页数:7页

时间:2020-04-07

时间片轮转算法介绍(doc 7页).doc_第1页
时间片轮转算法介绍(doc 7页).doc_第2页
时间片轮转算法介绍(doc 7页).doc_第3页
时间片轮转算法介绍(doc 7页).doc_第4页
时间片轮转算法介绍(doc 7页).doc_第5页
资源描述:

《时间片轮转算法介绍(doc 7页).doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、#include#include#include const int QueueNum=10;const int QueuePre=-1;const int ERROR=0;const int OK=1;const int TimePiece=1;typedef int ElemType; //head define..................../******************************************

2、*******************/ class Queue_c { ElemType Q[QueueNum]; int front,rear; public: //basic information of the class Queue_c: Queue_c(); int qFull(); int qEmpty(); int qEnQueue(ElemType e); ElemType qDeQueue(); int qGetNumber(); int qGetElem(int); int qS

3、howQueue();//other functions:ElemType qGetFrontElem(){if(qEmpty()){cout<<"ERROR!"<

4、

5、-=TimePiece; return OK; } //int qXChange(int); };//==================Define of Class Queue_c=====================================//============================================================================== class Work_c {Queue_c buf; public: int wCPU

6、();// ElemType wScan(int &t); int wMakeP(); int wShowBUF(){return buf.qShowQueue();} int wInBUF(int i){return buf.qEnQueue(i);} };//==================Define of Class Work_c=====================================//==========================================

7、====================================/*******************************==main==************************************************************************************==proc==***************************************************/ void main() { Work_c w; int i; /

8、/w.wInBUF(5); // w.wInBUF(3); // w.wInBUF(1); clrscr(); char flag='y'; for(i=0;i<10;i++) { //w.buf.qShowQueue(); w.wMakeP(); w.wCPU(); w.wShowBUF(); if(9==i) { cout<<"Are you want to continue?y/n"<>flag; if('n'==flag)b

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。