数据结构:队列与栈.pptVIP

  • 8
  • 0
  • 约1.55万字
  • 约 73页
  • 2019-10-23 发布于福建
  • 举报
  3. 入队操作 Status EnQueue(SqQueue Q , QElemType e) { if((Q.rear+1)%MAX_SIZE==Q.front)return ERROR; Q.rear=(Q.rear+1)% MAX_SIZE ; Q.data[Q.rear]=e ; return OK; } 4.出队操作 Status DeQueue(SqQueue Q, QElemType x ) { if (Q.front== Q.rear) return ERROR ; Q.front=(Q.front+1)% MAX_SIZE ; x=Q.data[Q.front] ; return OK ; } 链队列 链队列---队列的链式存储结构,它是限制仅在表头删除和表尾插入的单链表。 typedef struct node { QElemType data; struct node *next; } NODE; typedef struct queue { NODE *front; NODE *rear; }QUEUE; QUEUE Q; Q.front Q.rear Q 2 4 6 8 ^ (1)初始化队列Q Status InitQueue(

文档评论(0)

1亿VIP精品文档

相关文档