数据结构课件CH3栈和队列li幻灯片.pptVIP

  • 2
  • 0
  • 约1.34万字
  • 约 74页
  • 2018-03-26 发布于广东
  • 举报
* Status InitQueue (LinkQueue Q) { // 构造一个空队列Q Q.front = Q.rear = new QNode; if (!Q.front) exit (OVERFLOW); //存储分配失败 Q.front-next = NULL; return OK; } * Status EnQueue (LinkQueue Q, QElemType e) { // 插入元素e为Q的新的队尾元素 p = new QNode; if (!p) exit (OVERFLOW); //存储分配失败 p-data = e; p-next = NULL; Q.rear-next = p; Q.rear = p; return OK; } * Status DeQueue (LinkQueue Q, QElemType e) { // 若队列不空,则删除Q的队头元素, //用 e 返回其值,并返回OK;否则返回ERROR if (Q.

文档评论(0)

1亿VIP精品文档

相关文档