当前位置: 首页 > news >正文

网站怎么做备案赣州网页制作公司

网站怎么做备案,赣州网页制作公司,广州 网站建设网络推广网页设计,视频营销的策略与方法队列的基本概念 只允许在一端进行插入数据操作,在另一端进行删除数据操作的特殊线性表,队列具有先进先出 入队列:进行插入操作的一端称为队尾 出队列:进行删除操作的一端称为队头 队列用链表实现 队列的实现 队列的定义 队列…

队列的基本概念

只允许在一端进行插入数据操作,在另一端进行删除数据操作的特殊线性表,队列具有先进先出

入队列:进行插入操作的一端称为队尾

出队列:进行删除操作的一端称为队头

队列用链表实现

队列的实现

队列的定义

队列初始化

入队

出队

判断队列是否为空

销毁

队头数据

队尾数据

队列数据

运行调试

完整代码

Queue.h

#pragma once#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>typedef int QDataType;typedef struct QueueNode
{struct QueueNode* next;QDataType data;
}QNode;typedef struct Queue
{QNode* head;QNode* tail;int size;
}Que;void QueueInit(Que* pst);     //初始化队列void QueuePush(Que* pst,QDataType x);     //入队void QueuePop(Que* pst);          //出队bool QueueEmpty(Que* pst);          //判断队列是否为空int QueueSize(Que* pst);      //队列数据QDataType QueuBack(Que* pst);      //队尾数据QDataType QueueFront(Que* pst);       //队头数据void QueueDestroy(Que* pst);        //销毁队列

Queue.c

#define _CRT_SECURE_NO_WARNINGS 1#include "Queue.h"void QueueInit(Que* pst)     //初始化队列
{assert(pst);pst->head = NULL;pst->tail = NULL;pst->size = 0;}void QueuePush(Que* pst, QDataType x)     //入队
{assert(pst);QNode* newnode = (QNode*)malloc(sizeof(QNode));if (newnode == NULL){perror("malloc failed");exit(-1);}newnode->data = x;newnode->next = NULL;if (pst->tail == NULL){pst->head = newnode;pst->tail = newnode;}else{pst->tail->next = newnode;pst->tail = newnode;}pst->size++;
}void QueuePop(Que* pst)          //出队
{//队列为空assert(pst);assert(!QueueEmpty(pst));//队列只有一个元素if (pst->head->next == NULL){free(pst->head);pst->head = pst->tail = NULL;}//队列多个元素else{QNode* del = pst->head;pst->head = pst->head->next;free(del);}pst->size--;
}bool QueueEmpty(Que* pst)          //判断队列是否为空
{assert(pst);return pst->head == NULL;
}void QueueDestroy(Que* pst)        //销毁队列
{assert(pst);QNode* cur = pst->head;while (cur){QNode* next = cur->next;free(cur);cur = next;}pst->head = NULL;pst->tail = NULL;pst->size = 0;
}QDataType QueueFront(Que* pst)        //队头数据
{assert(pst);assert(!QueueEmpty(pst));return pst->head->data;
}QDataType QueuBack(Que* pst)      //队尾数据
{assert(pst);assert(!QueueEmpty(pst));return pst->tail->data;
}int QueueSize(Que* pst)      //队列数据
{assert(pst);return pst->size;
}

http://www.yayakq.cn/news/270915/

相关文章:

  • 如何做网站电话料远若近网站建设
  • 网站制作在百度上注册公司网站要多少钱
  • 网站建设实训报告要求游戏公司做网站设计赚钱吗
  • 信息发布网站开发模板企业咨询管理培训公司
  • 苏州做网站企业网站建设销售工作职责
  • 个人网站备案 服务内容怎么写免费投放广告的平台
  • 北京建外贸网站公司广安网站制作设计
  • 假网站如何做驻马店 网站建设
  • 做网站商城需要什么条件wordpress分类归档不科学
  • 网站怎么使用wordpress 阿里大于鱼
  • 合肥制作网站价格投标网招标网
  • 成都市温江建设局网站php网站开发心得
  • 网站没有备案是假的吗惠山做网站公司
  • 建设部网站业绩如何录入网站建设服务器搭建
  • 如何查看网站的外链WordPress 会员空间插件
  • 如何自己写一个网站青岛ui设计公司
  • 济南专业做公司网站的机构橙光游戏制作器手机版
  • 中国风手机网站模板什么软件可以制作图片加文字
  • 网站中怎么做图片的变换wap网站建设案例
  • 纯净软件网站推荐互联网营销师怎么做
  • 做网站1天转多钱做网站如何网站考虑优化
  • 让别人做网站注意事项长沙网站优化推广
  • 如何利用tp-link按错900做网站使用织梦系统建设网站教程
  • 新品发布会的目的seo网络推广经理招聘
  • 自己在家可以做网站吗php网站开发是做什么的
  • WordPress数据库和网站文件网站建设it职位
  • 型云网站建设衡水手机网站建设价格
  • 昆明建站网站资讯平台应用分析网站
  • 做网站西安哪家好中医协会网站建设方案
  • 开发技术网站开发技术路线wordpress开放用户注册