LRU页面置换算法.pdfVIP

  • 23
  • 0
  • 约2.82千字
  • 约 3页
  • 2022-05-22 发布于江苏
  • 举报
/* 这是LRU 页面置换算法 用队列实现 */ #includestdio.h #includestdlib.h #includemalloc.h #define N 11 int count=0;//记录缺页中断次数 int a[11]={6,4,3,2,1,4,5,6,5,2,1};//作业运行时,实际访问页面顺序 typedef struct Node{ int page; struct Node *next; }Node,*LinkList;// void Init_Memory(LinkList L)//初始化链表,假设开始时1,2,3 三个页面已经装入内存 { L=(LinkList)malloc(sizeof(Node)); L-next=NULL; int i; for(i=1;i=3;++i) { Node *s; s=(Node*)malloc(sizeof(Node)); if(!s) printf(error!\n); s-page=i; s-next=L-next;

文档评论(0)

1亿VIP精品文档

相关文档