/*
*Copyright (c) 2015 烟台大学计算机与控制工程学院
*All right reserved.
*标题:数据结构实践——负数把正数赶出队列
*作者:杨珺
*date:2015年10月12日
*版本:V1.0.1
*操作系统:XP
*运行环境:VC6.0
*问题描述: 设从键盘输入一整数序列a1,a2,…an,试编程实现:
当ai>0时,ai进队,当ai<0时,将队首元素出队,当ai=0时,表示输入结束。
要求将队列处理成环形队列,使用算法库中定义的数据类型及算法,
程序中只包括一个函数(main函数),入队和出队等操作直接写在main函数中即可。
当进队出队异常(如队满)时,要打印出错信息。
*/
sqqueue.h:
#ifndef SQQUEUE_H_INCLUDED
#define SQQUEUE_H_INCLUDED
#define MaxSize 5
typedef int ElemType;
typedef struct
{
ElemType data[MaxSize];
int front,rear;
} SqQueue;
void InitQueue(SqQueue *&q);
void DestroyQueue(SqQueue *&q);
bool QueueEmpty(SqQueue *q);
int QueueLength(SqQueue *q);
bool enQueue(SqQueue *&q,ElemType e);
bool deQue