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

怎么做一个商城网站家如何网站

怎么做一个商城网站,家如何网站,医疗类网站,龙岗做网站链式队列实现#xff1a; 1.创建一个空队列 2.尾插法入队 3.头删法出队 4.遍历队列 一、main函数 #include stdio.h #include ./3.linkqueue.h int main(int…链式队列实现 1.创建一个空队列 2.尾插法入队 3.头删法出队 4.遍历队列 一、main函数 #include stdio.h #include ./3.linkqueue.h int main(int argc, const char *argv[]) { linkpos* pos create_linkqueue(); show_linkqueue(pos);insertENd_linkqueue(pos,111); insertENd_linkqueue(pos,222); insertENd_linkqueue(pos,333); insertENd_linkqueue(pos,444); insertENd_linkqueue(pos,555); show_linkqueue(pos); dataType num output_linkqueue(pos); printf(出队的数据为%d\n,num); show_linkqueue(pos); return 0; } 二、功能函数 #include stdio.h #include stdlib.h #include ./3.linkqueue.h //创建 linkpos* create_linkqueue() { linkpos* pos (linkpos*)malloc(sizeof(linkpos)); pos-front (linkqueue*)malloc(sizeof(linkqueue)); if(NULL pos-front) { printf(队列创建失败\n); return NULL; } pos-front-next NULL; pos-rear pos-front; pos-front-text.len 0; return pos; } //判空 int isEmpty_linkqueue(linkpos*pos) { return pos-front pos-rear?1:0; } //遍历 void show_linkqueue(linkpos*pos) { if(isEmpty_linkqueue(pos)) { printf(队列为空\n); return ; } linkqueue* p pos-front-next; while(p ! pos-rear) { printf(%d ,p-text.data); pp-next; } printf(\n); return ; } //尾插 入队 void insertENd_linkqueue(linkpos*pos,dataType num) { linkqueue* temp (linkqueue*)malloc(sizeof(linkqueue)); if(NULL temp) { printf(结点创建失败入队失败\n); return; } temp-next NULL; temp-text.data num; temp-next pos-rear-next; pos-rear-next temp; pos-rear pos-rear-next; pos-front-text.len; return; } //头删 出队 dataType output_linkqueue(linkpos*pos) { if(isEmpty_linkqueue(pos)) { printf(队列为空无法出队\n); return (dataType)-1; } linkqueue* temp; temp pos-front-next; pos-front-next temp-next; dataType num temp-text.data; if(pos-front-next NULL) {pos-rear pos-front;} free(temp); return num; } 三、头文件 #ifndef __LINKQUEUE_H__#define __LINKQUEUE_H__typedef int dataType;union msg{dataType data;int len;};typedef struct node{union msg text;struct node* next;}linkqueue;typedef struct{linkqueue* front;linkqueue* rear;}linkpos;linkpos* create_linkqueue();void insertENd_linkqueue(linkpos*pos,dataType num);dataType output_linkqueue(linkpos*pos);void show_linkqueue(linkpos*pos); #endif 四、运行结果
http://www.pierceye.com/news/581503/

相关文章:

  • 公司网站开发费用计入什么科目虚拟主机怎么建网站
  • 天津网站建设技术网页设计与制作教程版徐洪亮课后答案
  • 旅游网站建设方案简介用asp做的网站打开页面很慢
  • 做影视网站 片源从哪里来做自媒体的上那些网站
  • 邢台网站开发百度云 做网站
  • 淘宝优惠劵网站建设wordpress主题 简洁
  • 自己做电影资源网站揭阳新闻最新消息
  • 北碚免费建站哪家做得好佛山网站建设设计
  • 怎么做网站拍卖的那种wordpress主题搜索图标
  • 三亚网站建设平台查数据的权威网站
  • html网站制作答辩ppt网站备份和备案的区别
  • 网站开发需要工具免费的ps软件
  • 常州网站建设优质商家重庆互联网怎么样
  • 做网站发广告动漫网页设计报告
  • 求职招聘网站建设投标书沈阳网站建设的公司哪家好
  • 做导航网站有发展吗南京企业网站制作哪家好
  • 千万pv网站开发成本招聘网站数建设
  • 吐鲁番大型网站建设平台找客户去哪个平台
  • 权威网站有哪些给个网站可以在线
  • 优化网站专题北京海淀网站建设公司
  • 广州网站快速排名网站维护正常要多久
  • 建网站 选安全甘肃做网站价格
  • 微信公众管理平台有必要买优化大师会员吗
  • 家居网站建设素材腾讯adq广告平台
  • 响应式网站 图片居中门户网站样式
  • 潍坊网站排名推广北京建设高端网站的
  • 广东省住房和建设网站鹤壁市建设局网站
  • 北京网站建设报价明细手机网站网站开发流程
  • 三合一网站模板如何看网站是html几代做的
  • 如何设置自己的网站网站建设的常用词