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

临沂吧网站建设wordpress图片不显示

临沂吧网站建设,wordpress图片不显示,河北特定网站建设推荐,海淀网站建设多少钱🌈个人主页:羽晨同学 💫个人格言:“成为自己未来的主人~” 队列 队列的概念及结构 队列:只允许在一端进行插入数据操作,在另一端进行删除删除数据操作的特殊线性表,队列具有先进先出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/10054/

相关文章:

  • 企业建站套餐巩义网络推广
  • wap网站制作模板网站建设推广用兴田德润
  • 有专门做特产的网站吗百度seo优化推广公司
  • 深圳做男装什么网站容易找工qq网页版登录官网登录入口
  • 网站服务器租用价格多少钱一年网站开发要注意的问题
  • 用织梦做的网站一般后台大学 建网站
  • 济南哪家公司做网站好椒江网站建设
  • 小语种网站建设要点优秀网页制作模板
  • 手机自适应网站公司简介模板范文高大上
  • 网站后台传不上图片软件开发的步骤流程
  • 东莞app培训网站建设wordpress配置163邮箱
  • 宁波网站免费制作工程建设教育网站
  • 辽宁网站设计视频制作流程
  • 关于建设网站的通知wordpress 淘宝客api
  • 北京有哪些网站建设公司小说推广赚钱平台哪个好
  • 博客网站推广法平台制作网站公司
  • 深圳招聘网站大全广西网站建设服务好
  • 5 还有网站的域铁岭公司做网站
  • 沈阳核工业建设工程总公司网站企业 网站微信 建设
  • 专业做网站多少钱服务器网站后台登陆密码黄框显示
  • 网站建设哪家学校好十堰最新新闻今天
  • 做一个小网站需要多少钱js网站大全
  • 重庆网站建设行业新闻自建站排名
  • 做网站的荣誉证书网销网站建设流程
  • 游戏类企业网站模板阿里云主机上传网站
  • 西安网站seo公司html页面生成器
  • 广元市建设局网站首页欧美建设网站
  • 写作网站免费网站开发的步骤实训内容
  • 南磨房做网站公司小程序打不开什么原因
  • dedecms做网站视频宁波seo关键词优化外包