.h
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <crtdbg.h>
typedef int QElemType;
typedef struct QueueNode
{
struct QueueNode* next;
QElemType data;
}QueueNode;
typedef struct Queue
{
QueueNode* head;
QueueNode* tail;
}Queue;
void QueueInit(Queue* pq);
void QueueDestroy(Queue *pq);
void QueuePush(Queue* pq, QElemType x);
void QueuePop(Queue* pq);
QElemType Get_QueueFront(Queue* pq); //取队头元素
QElemType Get_QueueBack(Queue* pq); //取队尾元素
int QueueSize(Queue* pq);
bool QueueEmpty(Queue* pq);
QueueNode* Buynode();
.cpp
void QueueInit(Queue* pq)
{
assert(pq != NULL);
pq->head = pq->tail = NULL;
}
void QueueDestroy(Queue *pq)
{
assert(pq != NULL);
QueueNode *cur = pq->head;
while (cur !&#
|