1 Star 0 Fork 0

Admin / text_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Queue.h 744 Bytes
一键复制 编辑 原始数据 按行查看 历史
Admin 提交于 2024-05-08 20:36 . 队列
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
// 链式结构:表示队列
typedef int QueueDataType;
typedef struct QListNode
{
QueueDataType val;
struct QueueNode* next;
}QNode;
// 队列的结构
typedef struct Queue
{
QNode* phead; //方便找尾节点,降低时间复杂度
QNode* ptail;
int size; //记录链表长度
}Queue;
//一些基本操作!!!
//初始化与删除
void QueueInit(Queue* pq);
void QueueDestroy(Queue* pq);
//出队列与入队列
void QueuePush(Queue* pq, QueueDataType x);
void QueuePop(Queue* pq);
//出头节点与尾节点
QueueDataType QueueFront(Queue* pq); //返回该节点的数据
QueueDataType QueueBack(Queue* pq);
//判断是否为空
bool QueueEmpty(Queue* pq);
//打印队列
void QueuePrintf(Queue* pq);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/small-c_2_0/text_cpp.git
git@gitee.com:small-c_2_0/text_cpp.git
small-c_2_0
text_cpp
text_cpp
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891