2014年3月27日

稀里糊涂的队列

摘要: 链队列typedef struct QNode{ QElemType data; struct QNode *next;}QNode,* QueuePtr;typedef struct { QueuePtr front;//队头指针 QueuePtr rear;//队尾指针} LinkQueue;1.构造空队列Status InitQueue(LinkQueue &Q){ Q.front=Q.rear=(QueuePtr)malloc(sizeof(QNode)); if(!Q.front) exit(OVERFLOW); //存储分配失败 Q.front->next=NULL; 阅读全文

posted @ 2014-03-27 20:18 droidxin 阅读(236) 评论(0) 推荐(0) 编辑

导航