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

react 做网站百度竞价包年推广公司

react 做网站,百度竞价包年推广公司,一万并发量的视频网站建设,网站开发程序制作域名备案队列的基本概念 只允许在一端进行插入数据操作,在另一端进行删除数据操作的特殊线性表,队列具有先进先出 入队列:进行插入操作的一端称为队尾 出队列:进行删除操作的一端称为队头 队列用链表实现 队列的实现 队列的定义 队列…

队列的基本概念

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

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

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

队列用链表实现

队列的实现

队列的定义

队列初始化

入队

出队

判断队列是否为空

销毁

队头数据

队尾数据

队列数据

运行调试

完整代码

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.mmbaike.com/news/72343.html

相关文章:

  • 潍坊网站建设 潍坊做网站网站流量查询站长之家
  • 莒县做网站和微信百度广告联盟价格
  • wordpress网站首页电商中seo是什么意思
  • 新手如何建站seo搜索优化公司排名
  • 西宁网站优化公司推广方法有哪些
  • 网站备案连接怎么做seo是什么意思新手怎么做seo
  • 网站备案要关多久百度开户代理公司
  • 苏州专业做网站公司哪家好苏州排名搜索优化
  • 宜选网的网站是什么做的黄冈网站推广软件
  • 仙游网站建设公司公司网站制作公司
  • 一个网站需要怎么做百度如何优化排名靠前
  • 网站建设项目预算表清博大数据舆情监测平台
  • 武侯区网站建设哪里好点宁波seo优化费用
  • 房产中介做租单用哪个付费网站更好手机网页制作app
  • wordpress新建网站seo推广软件
  • 专门做期货的网站域名估价
  • 微山网站建设哪家便宜2023年东莞疫情最新消息
  • 东莞php网站建设价格如何自制网站
  • wordpress 插件设置广州优化疫情防控举措
  • 做平面免费接单网站长沙seo排名优化公司
  • 导购网站怎么做有特色朝阳网络推广
  • 残联网站建设概况什么软件比百度搜索好
  • 福田网站建设青岛seo公司
  • 杭州平面设计师工资一般多少百度地图关键词优化
  • 推荐个靠谱的网站西安seo全网营销
  • ppt免费网站自媒体135网站免费下载安装
  • 怎么创建万维网网站厂房网络推广平台
  • 在网站开发中哪里需要js文件外贸快车
  • 开发高端网站建设设计公司
  • 网站网站建设网页设计网站推广途径和推广要点有哪些?