入队在队尾
p -> data = e;
p -> next = NULL;//因为在队尾入队所以入队后后继无数据为空
s.rear -> next = p;
s.rear = p;
队列的出队是在队头进行的
p = s.froat -> next;
e = p -> data;
s.froat -> next = p -> next;
free(p);
if(s.rear == p)
{
s.rear = s.froat;//表示队列已空
}
#include <stdio.h>
#include <stdlib.h>
typedef int ElemType;
typedef struct SqQueue{
ElemType data;
struct SqQueue *next;