链式队列的实现细节与运行机制.docVIP

  • 4
  • 0
  • 约1.86千字
  • 约 5页
  • 2016-06-05 发布于重庆
  • 举报
链式队列的实现细节与运行机制

链式队列的实现细节与运行机制 【实现方法】 数据结构: //队列要求只能从对尾进从对头出,对头不动 typedef struct tQueueNode{ //队列结构 pBITREE ptree; //存储树节点指针 tQueueNode* next; }QueueNode,*pQueueNode; typedef struct tQueue{ pQueueNode rear; //队尾 pQueueNode head; //对头 }LinkListQue; 几个基本的重要函数 Status InitQue(LinkListQue que) { //队头和队尾地址相同 que.rear = que.head = (pQueueNode)malloc(sizeof(QueueNode)); if(que.rear==NULL || que.head==NULL){ return ERROR; } que.head-next = NULL; que.head-ptree = NULL; que.rear-next = NULL; que.rear-ptree = NULL; return OK; } //节点入队 Status ENQue(LinkListQue que,pBITREE pNode) { pQueueNode p = (pQueue

文档评论(0)

1亿VIP精品文档

相关文档