lru.h

来自「LRU对列队的实现,就是实现找出最近最少用的元素的算法.」· C头文件 代码 · 共 30 行

H
30
字号

#include <iostream.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>

#define LEASTPAGES 8
#define MAXSIZE 5
#define OK 1
#define ERROR -1
#define FALSE 0
#define TRUE 1

typedef int Status;
typedef int ElemType;

typedef struct Queue{
	ElemType *base;
	int front;
	int rear;
}Queue, *QueueLink;

Status InitQueue( Queue &Q );
Status QueueLength( Queue Q );
Status EnQueue( Queue &Q, ElemType e );
Status VisualQueue( Queue Q );
int find( Queue &Q, int nID );

void Init( Queue &Q1, Queue &Q2 );
void play( Queue &Q1, Queue &Q2 );

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?