queue.h
来自「离散事件模拟程序」· C头文件 代码 · 共 39 行
H
39 行
/*
file: queue.h
链队列
队列的链式表示和实现
*/
#ifndef _QUEUE_H_
#define _QUEUE_H_
#include "com_def.h"
// 数据类型
typedef struct _QElemType
{
int i;
}QElemType;
typedef struct _QNode
{
QElemType data;
struct _QNode *next;
}QNode, *QueuePtr;
typedef struct
{
QueuePtr front;
QueuePtr rear;
}LinkQueue;
bool InitQueue(LinkQueue *Q);
bool DestroyQueue(LinkQueue *Q);
bool ClearQueue(LinkQueue *Q);
bool QueueEmpty(LinkQueue Q);
int QueueLength(LinkQueue Q);
bool GetHead(LinkQueue Q, QElemType *pdata);
bool EnQueue(LinkQueue *Q, QElemType data);
bool DeQueue(LinkQueue *Q, QElemType *pdata);
bool QueueTraverse(LinkQueue *Q, bool (*visit)(QElemType *));
#endif // _QUEUE_H_
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?