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

seo网站优化信息系统开发计划

seo网站优化,信息系统开发计划,wordpress 文章名翻译,ftp怎么连接网站空间🌈个人主页:羽晨同学 💫个人格言:“成为自己未来的主人~” 队列 队列的概念及结构 队列:只允许在一端进行插入数据操作,在另一端进行删除删除数据操作的特殊线性表,队列具有先进先出FIFO,…

🌈个人主页:羽晨同学 

💫个人格言:“成为自己未来的主人~”  

队列

队列的概念及结构

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

队列的实现

队列也可以数组和链表的结构实现,使用链表的结构实现更优一点,因为如果使用数组的结构,出队列在数组头上出数据,效率会比较低

#pragma once
#include<stdio.h>
#include<stdbool.h>
#include<assert.h>typedef int QDataType;
typedef struct QueueNode
{int 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, QDataType x);
//出队列
void QueuePop(Queue* pq);QDataType QueueFront(Queue*pq);
QDataType QueueBack(Queue* pq);
bool QueueEmpth(Queue* pq);
int QueueSize(Queue* pq);
#define _CRT_SECURE_NO_WARNINGS
#include"code.4.5.Queue.h"
void QueueInit(Queue* pq) {assert(pq);pq->phead = NULL;pq->ptail = NULL;pq->size = 0;
}void QueueDestroy(Queue* pq)
{assert(pq);QNode* cur = pq->phead;while (cur) {QNode* next = cur->next;free(cur);cur = next;}pq->phead = pq->ptail = NULL;pq->size = 0;
}//入队列
void QueuePush(Queue* pq, QDataType x) {assert(pq);QNode* newnode = (QNode*)malloc(sizeof(QNode));if (newnode == NULL) {perror("malloc fail");return;}newnode->val = x;newnode->next = NULL;if(pq->ptail){pq->ptail->next = newnode;pq->ptail = newnode;}pq->size++;
}
void QueuePop(Queue* pq)
{assert(pq);assert(pq->phead != NULL);if (pq->phead->next == NULL) {free(pq->phead);pq->phead = pq->ptail = NULL;}else{QNode* next = pq->phead->next;free(pq->phead);pq->phead = next;}pq->size--;
}QDataType QueueFront(Queue* pq) {assert(pq);assert(pq->phead != NULL);return pq->phead->val;
}
QDataType QueueBack(Queue* pq) {assert(pq);assert(pq->ptail != NULL);return pq->ptail->val;
}
bool QueueEmpth(Queue* pq)
{assert(pq);return pq->size == 0;
}
int QueueSize(Queue* pq)
{assert(pq);return pq->size;
}
#define _CRT_SECURE_NO_WARNINGS
#include"code.4.5.stack.h"
//int main() {
//	ST s;
//	STInit(&s);
//	STPush(&s,1);
//	STPush(&s,2);
//	STPush(&s,3);
//	int top = STTop(&s);
//	printf("%d", top);
//
//	STDestroy(&s);
//	return 0;
//}
#include"code.4.5.Queue.h"
int main()
{Queue q;QueueInit(&q);QueuePush(&q, 1);QueuePush(&q, 2);printf("%d ", QueueFront(&q));QueuePop(&q);QueuePush(&q, 3);QueuePush(&q, 4);while (!QueueEmpth(&q)){printf("%d ", QueueFront(&q));QueuePop(&q);}QueueDestroy(&q);return 0;
}

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

相关文章:

  • php多商户商城广州四楚seo顾问
  • 电子商务网站建设任务分解网站优化培训学校
  • 商业网站建设教程女生适合学什么专业
  • 网站做等保测评网上书店网站建设毕业设计
  • 创新型的合肥网站建设wordpress底部菜单插件
  • 公司的网站建设费应该怎么入账网站建设公司中心
  • 建站平台企业排名网站需求文档范例
  • 广州做地铁的公司网站关注济南网站建设
  • c 网站开发项目西宁网站建设哪家好
  • wordpress做出影视网站嘉兴专业自助建站免费咨询
  • 南京网站制作多少钱专做婚礼logo的网站
  • 检测网站点击量域名多少钱一年
  • 医院网站建设安全协议广告投放怎么做
  • 美妆网站源码asp培训心得体会范文大全1000
  • 山西做网站的政务网站建设工作计划结尾
  • 怎么寻求网站建设什么样的网站流量容易做
  • 酒水销售网站seo及网络推广招聘
  • 邯郸网站设计开发公司万网买的网站备案
  • 学校网站设计论文西安网站建设的网站
  • 网站开发工程师需要哪些技术热门传奇网页游戏排行榜
  • 用dw如何做网站链接网站公司的利润
  • 泰州高端网站建设商务网站开发的基本流程
  • 永安网站建设网站建设方案汇报
  • 百捷网站建设网站后台用什么软件做
  • 网站中搜索栏怎么做的安庆哪些做网站的公司好
  • 哪个网站有利于做课件深圳积分商城网站建设
  • 企业网站建设 毕业设计设计排版优秀网站
  • 做网站硬件做导购网站多少钱
  • 商务网站规划建设与管理试卷wordpress微信 加速
  • 大岭山网站建设网页制作软件 知乎