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

做网站用php还是python培训心得总结怎么写

做网站用php还是python,培训心得总结怎么写,seo刷排名公司,h5网站开发模板🌈个人主页:羽晨同学 💫个人格言:“成为自己未来的主人~” 队列 队列的概念及结构 队列:只允许在一端进行插入数据操作,在另一端进行删除删除数据操作的特殊线性表,队列具有先进先出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.shuangfujiaoyu.com/news/42863.html

相关文章:

  • 大连建设主管部门网站东莞网络推广培训
  • 网站开发报告参考文献深圳网络推广最新招聘
  • 移动网站建设学习做博客的seo技巧
  • 杭州萧山网站建设公司网页设计工资一般多少
  • 手机怎样建立网站南昌网站seo
  • 做政府网站的百度网盘官方下载
  • 网站建设开发定制武汉seo关键词排名优化
  • 红色企业网站2023b站免费推广入口
  • 柬埔寨做网站seo关键词工具
  • 做外贸建网站需要推广吗网络营销课程
  • 深圳福田车公庙网站建设郑州seo优化顾问热狗
  • 如何免费建个人网站旺道优化软件
  • 色91Av做爰网站域名买卖交易平台
  • dreamweaver好学吗seo网络营销外包公司
  • 微信支付 网站建设营销型网站有哪些
  • 初学者学做网站怎么学每日舆情信息报送
  • 国外建站网址网站建设有多少公司
  • 丰都集团网站建设下载谷歌浏览器
  • 网站备案委托书在线网络培训平台
  • 网站建设 10万元谷歌seo优化中文章
  • 重庆政府门户网站52种新颖的促销方式
  • 网站 公司形象网络营销实施方案
  • wordpress 域名绑定后 手机网站seo诊断优化方案
  • 迁西网站建设百度关键词排名快速排名
  • 惠州网站建设制作公司2023必考十大时政热点
  • js特效如何放到网站上宁波seo整体优化公司
  • 河南中安建设集团有限公司网站手机网站模板
  • 企业网站开发与管理最好的免费建站网站
  • 五大门户网站分别是站长工具在线平台
  • 杭州外贸网站建设公司价格排名点击软件怎样