数据结构第3章绪论.pptVIP

  • 14
  • 0
  • 约1.79万字
  • 约 84页
  • 2017-02-14 发布于湖北
  • 举报
链队列的类型定义 typedef struct QNode{ QElemType data; struct QNode *next; }QNode, *QueuePtr; typedef struct{ QueuePtr front; //队头指针 QueuePtr rear; //队尾指针 }LinkQueue; 链队列 LinkQueue Q; 队空的条件:Q.front = Q.rear;(有头结点) Q.front = NULL;(无头结点) 初始化 InitQueue(LinkQueue Q) { Q.front = Q.rear =new QNode; if(!Q.front) exit(OVERFLOW); Q.front-next = NULL; return OK; } sun p zhou jin 0 xin Q.front Q.rear 0 Q.rear 入队列 EnQueue(LinkQueue Q, QElemType e) { p = new QNode; if(!p) exit(OVERFLOW); p-data = e; p-next = NU

文档评论(0)

1亿VIP精品文档

相关文档