kehu2.h
来自「行天订票系统,一个航天的机票管理系统,主要是针对数据结构来设计的」· C头文件 代码 · 共 39 行
H
39 行
#ifndef H_kehu2
#define H_kehu2
#include "newString.h"
#include <iostream.h>
#include <fstream.h>
#define OK 1;
#define FALSE 0;
typedef int Status;
typedef struct
{
newString name; //预约订票的客户的姓名
int number; //订票量
}QElemType;
typedef struct kehu2
{
QElemType data;
struct kehu2 *next;
}kehu2,*Kehu2Ptr;
typedef struct
{
Kehu2Ptr front; //队头指针
Kehu2Ptr rear; //队尾指针
}Kehu2Queue;
Status InitQueue(Kehu2Queue &q); //构造一个空队列
Status EnQueue(Kehu2Queue &q,QElemType e); //插入元素e为q的新的队尾元素
Status EnQueue(Kehu2Queue &q); //按输入新增队列元素
Status CreateQueue(Kehu2Queue &q,ifstream& infile); //从文件读入数据,新建队列q
void PrintQueue(Kehu2Queue q); //显示客户队列的所有信息
void PrintQueue_H(Kehu2Queue q); //显示客户队列头结点的信息
Status GetQueue(Kehu2Queue &q,QElemType &e,int i); //若队列不空且存在符合i要求的结点,则将该结点的值与头结点交换,返回OK;否则返回FALSE
Status DeQueue(Kehu2Queue &q,QElemType &e); //若队列不空,则删除q的队头元素,用e返回其值
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?