数据结构链队列的基本操作
在这里插入代码片#include<stdio.h>
#include<stdlib.h>
#define QElemType int
#define Status int
#define STACK_INIT_SIZE 100
#define STACKINCREMENT 10
#define OK 1
#define ERROR 0
#define ERROR1 2
typedef struct QNode{
QElemType data;
struct QNode *next;
}QNode, *QueuePtr;
typedef struct {
QueuePtr front=NULL; // 队头指针
QueuePtr rear=NULL; // 队尾指针
}LinkQueue; // 链队列
void menu();
Status judgeQueue(LinkQueue); //判断是否建立队列 1
Status InitQueue(LinkQueue&); //构造空队列 2
Status DestroyQueue(LinkQueue&) ; //销毁队列结构3
Status ClearQueue (LinkQueue&); //队列清空 4
Status QueueEmpty (LinkQueue) ; //判空 5
Status QueueLength (LinkQueue,QElemType & ) ; //求队列长6
void GetHead (LinkQueue, QElemType & ); //(求队头元素)7
Status EnQueue (LinkQueue&, QElemType ); //(入队)8
Status DeQueue (LinkQueue&, QElemType &); // (出队)9
Status putout(LinkQueue); //输出队列10
Status creatintput(LinkQueue &); //创建并输入 12
int main()
{
menu();
int select,n;
QElemType m;
LinkQueue L;
while(1)
{
printf("请输入您的选择:\n");
scanf("%d",&select);
if(select<=0||select>11)
printf("您的选择超出范围。\n");
else
{
switch(select)
{
case 1:
if(InitQueue(L)) printf("初始化完成。\n");
else prin