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

做商城网站系统竞价恶意点击立案标准

做商城网站系统,竞价恶意点击立案标准,网站logo怎么修改,浙江网络科技有限公司1.队列的概念以及结构 队列#xff1a;只允许在一端进行插入数据操作#xff0c;在另一端进行删除数据操作的特殊线性表#xff0c;队列具有先进先出FIFo(Frist in Frist out)的特性 入队列#xff1a;进行插入才操作的一端称为队尾 出队列#xff1a;进行删除操作的一…1.队列的概念以及结构 队列只允许在一端进行插入数据操作在另一端进行删除数据操作的特殊线性表队列具有先进先出FIFo(Frist in Frist out)的特性 入队列进行插入才操作的一端称为队尾 出队列进行删除操作的一端称为队头 2.队列的实现 队列也可以使用数组和链表的结构实现使用链表的结构实现更优一些因为如果使用数组的结构出队列在数组头上出数据效率会很低 队列常见的基本操作 //初始化 void QueueInit(Queue* pq); //清空队列成员 void QueueDestroy(Queue* pq); //队尾插入元素 void QueuePush(Queue* pq, QDataType x); //删除队队头元素队列先进先出 void QueuePop(Queue* pq); //获取队头元素 int QueueFront(Queue * pq); //获取队尾元素 int QueueBack(Queue* pq); //获取队列中有效与元素个数 int QueueSize(Queue* pq); //查看队列是否为空 bool QueueEmpty(Queue* pq); 每个功能的实现以及解释 实现队列这里我们使用的是动态顺序表 -1.初始化队列 //初始化 void QueueInit(Queue* pq) {assert(pq);pq-head pq-tail NULL;pq-size 0; } -2.清空队列成员 //清空队列成员 void QueueDestroy(Queue* pq) {assert(pq);QNode* cur pq-head;//QNode* cur pq-head-next;while (cur){/*free(pq-head);pq-head cur;cur cur-next;*/QNode* next cur-next;free(cur);cur next;}pq-head pq-tail NULL;pq-size 0; } -3.队尾插入元素 //队尾插入元素 void QueuePush(Queue* pq, QDataType x) {QNode* newnode (QNode*)malloc(sizeof(QNode));if (NULL newnode){perror(QueuePsuh::malloc);return;}newnode-data x;newnode-next NULL;if (pq-head NULL){assert(pq-tail NULL);pq-head pq-tail newnode;}else{pq-tail-next newnode;pq-tail newnode;}pq-size; } -4.删除队队头元素队列先进先出 //删除队列成员队列先进先出 void QueuePop(Queue* pq) {assert(pq);assert(pq-head ! NULL);//第一种方法//Queue* cur pq-head;//if (cur-next NULL)//{// free(cur);// pq-head pq-tail NULL;//}/*else{pq-head cur-next;free(cur);cur NULL;}*///第二种方法QNode* next pq-head-next;free(pq-head);pq-head next;if (pq-head NULL){pq-tail NULL;}pq-size--; } -5.获取队头元素 //获取队头成员 int QueueFront(Queue* pq) {assert(pq);assert(pq-head);return pq-head-data; } -6.获取队尾元素 //获取队尾成员 int QueueBack(Queue* pq) {assert(pq);assert(!QueueEmpty(pq));return pq-tail-data; } -7.获取队列中有效元素个数 //获取队列中有效元素个数 int QueueSize(Queue* pq) {assert(pq);return pq-size; } -8.查看队列是否为空 //查看队列是否为空 bool QueueEmpty(Queue* pq) {assert(pq);return pq-size 0; //pq-head NULL pq-tail NULL } 3.完整代码 Queue.h #define _CRT_SECURE_NO_WARNINGS 1 #include stdio.h #include stdbool.h #include assert.h #include stdlib.htypedef int QDataType;typedef struct QListNode {struct QListNode* next;QDataType data; }QNode;typedef struct Queue {QNode* head;QNode* tail;QDataType size; }Queue;//初始化 void QueueInit(Queue* pq); //清空队列成员 void QueueDestroy(Queue* pq); //队尾插入队列 void QueuePush(Queue* pq, QDataType x); //删除队队头元素队列先进先出 void QueuePop(Queue* pq); //获取队头元素 int QueueFront(Queue * pq); //获取队尾元素 int QueueBack(Queue* pq); //获取队列中有效与元素个数 int QueueSize(Queue* pq); //查看队列是否为空 bool QueueEmpty(Queue* pq); Queue.c #include queue.h//初始化 void QueueInit(Queue* pq) {assert(pq);pq-head pq-tail NULL;pq-size 0; }//销毁队列 void QueueDestroy(Queue* pq) {assert(pq);QNode* cur pq-head;//QNode* cur pq-head-next;while (cur){/*free(pq-head);pq-head cur;cur cur-next;*/QNode* next cur-next;free(cur);cur next;}pq-head pq-tail NULL;pq-size 0; }//插入队列成员 void QueuePush(Queue* pq, QDataType x) {QNode* newnode (QNode*)malloc(sizeof(QNode));if (NULL newnode){perror(QueuePsuh::malloc);return;}newnode-data x;newnode-next NULL;if (pq-head NULL){assert(pq-tail NULL);pq-head pq-tail newnode;}else{pq-tail-next newnode;pq-tail newnode;}pq-size; }//删除队列成员队列先进先出 void QueuePop(Queue* pq) {assert(pq);assert(pq-head ! NULL);//Queue* cur pq-head;//if (cur-next NULL)//{// free(cur);// pq-head pq-tail NULL;//}/*else{pq-head cur-next;free(cur);cur NULL;}*/QNode* next pq-head-next;free(pq-head);pq-head next;if (pq-head NULL){pq-tail NULL;}pq-size--; }//获取队头成员 int QueueFront(Queue* pq) {assert(pq);assert(pq-head);return pq-head-data; }//获取队列中有效元素个数 int QueueSize(Queue* pq) {assert(pq);return pq-size; }//获取队尾成员 int QueueBack(Queue* pq) {assert(pq);assert(!QueueEmpty(pq));return pq-tail-data; }//查看队列是否为空 bool QueueEmpty(Queue* pq) {assert(pq);return pq-size 0; //pq-head NULL pq-tail NULL } test.c #include queue.hint main() {Queue st;QueueInit(st);QueuePush(st, 1);QueuePush(st, 2);QueuePush(st, 3);QueuePush(st, 4);QueuePush(st, 5);while (!QueueEmpty(st)){printf(%d , QueueFront(st));QueuePop(st);}printf(\n);return 0; } 测试结果:
http://www.hkea.cn/news/14556907/

相关文章:

  • 温州网络公司网站建设网站续费 多久
  • 陕西铜川煤矿建设有限公司网站永康物流网站
  • 平面设计案例网站推荐wordpress禁止采集
  • 广州网站制作费用olam wordpress
  • 自适应网站运动div如何设置的视频网站的链接怎么做的
  • 学网站开发需要多长时间跨境电商平台的特点
  • 网站制作公司源码wordpress卡蜜主题
  • 网站的线下推广怎么做双通网络网站建设价格
  • 老区建设网站如何建设自己网站首页
  • 成都市做网站公司建设网站公司怎么建站
  • 安徽省建设厅网站怎么进不去网站开发后端培训
  • 网站商品台管理系统做外贸的网站有哪些
  • 互动网站策划微信公众号商城开发
  • 创网网站后台管理系统怎么做支付网站
  • 西安网站网络营销上海优化排名公司
  • 旅游网站设计的建设原则页面设计设计风格
  • 做网站怎么与客户谈判建站公司电话
  • 简述网站制作基本流程wordpress高级轮播
  • 哪个网站ppt模板免费下载碑林微网站建设
  • 企业信息管理系统官网手机端网站如何优化
  • 潍坊网站建设培训班如何做介绍一门课程的网站
  • 阿里云买域名后怎么做网站杭州做产地证去哪个网站
  • 企业网站设置王也夫
  • 电力建设规范下载网站国内外知名建设设计网站
  • 网站安装系统怎么安装教程视频湖南做网站磐石网络案例
  • 手机网站的好处做网站的时候字体应该多大
  • 工具网站有哪些南平 建网站
  • 网站建设计划书实验总结徐州英文网站优化
  • 阿里云上的网站建设青岛外贸网站制作
  • 在哪学习建网站阳江58同城招聘网最新招聘