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

做网站用php还是python襄阳seo培训

做网站用php还是python,襄阳seo培训,苹果手机app安装下载,网站制作资源🌈个人主页:羽晨同学 💫个人格言:“成为自己未来的主人~” 队列 队列的概念及结构 队列:只允许在一端进行插入数据操作,在另一端进行删除删除数据操作的特殊线性表,队列具有先进先出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.tj-hxxt.cn/news/26855.html

相关文章:

  • 用front page2003做网站的导航条站长素材
  • 网站配色方案搜索引擎优化的主要策略
  • 网站响应式是什么意思最近新闻头条最新消息
  • 去哪里可以做网站竞价外包代运营公司
  • asp. net 做网站长沙网站seo推广
  • 西安市住宅和城乡建设局网站口碑营销属于什么营销
  • 网站营销案例展示广州推动优化防控措施落地
  • 哪个威客网站做翻译最赚钱武汉大学人民医院东院
  • 政府网站外语版建设郴州网络推广外包公司
  • 做网站建设比较好的公司小白如何学电商运营
  • 电子商城网站开发盐城seo网站优化软件
  • 邯郸最新工程项目公示宁波seo网站排名
  • 医疗网站建设计划书百度seo网站在线诊断
  • app设计素材网站最快的新闻发布平台
  • 秋长网站建设软件推广
  • 天河区网站建设百度代运营公司
  • 广东省网站建设公司建网站需要多少钱
  • 关键词网站排名顾问搜索引擎排行榜
  • 软件工程师招聘简章pdf免费百度seo排名培训
  • 子目录做网站福建seo
  • php网站的后台地址360网站seo手机优化软件
  • 潮州哪里做网站建立网站步骤
  • 用.net做视频网站的案例网络广告投放公司
  • 关于党建网站建设的建议全网营销渠道
  • 模版网站和语言网站怎么才能建立一个网站卖东西
  • 门户型网站上海网络推广营销策划方案
  • 北京网站制作建设公司长沙seo推广外包
  • 东莞著名网站建设企业网站策划书怎么写
  • 浙江省关于加强新闻网站建设口碑营销的步骤
  • 网站管理的主要工作有哪些有域名有服务器怎么做网站