当前位置: 首页 > 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.zqtcl.cn/news/581503/

相关文章:

  • 在手机上怎么做微电影网站湖南人工智能建站系统软件
  • 网站做的一样算侵权吗站群建站系统
  • 骨干专业建设验收网站xueui wordpress
  • 宁波高质量品牌网站设计厂家世界上有php应用的网站
  • 网站平台建设的重要性响应式网站切图
  • 近期做网站需要什么软件网站制作常见的问题
  • vs做的本地网站甘肃省建设厅门户网站
  • 网站建设合同义务wordpress m1
  • 青海省建设局网站首页wordpress模板建站教程视频
  • 演示 又一个wordpress站点静态页面加wordpress
  • 企业做淘宝客网站有哪些有网站吗给一个
  • 深圳网站制作公司信息之梦与wordpress哪个好用
  • 免费搭建商城网站山西制作网站公司排名
  • 网站开发免费中建建设银行网站
  • 301重定向到新网站在线建站
  • 曰本做爰l网站沙朗做网站公司
  • 广州网站设计智能 乐云践新专家wordpress 头像设置
  • 电子商务学网站建设好吗佛山市手机网站建设企业
  • 为企业做网站电话开场白小说网站的里面的搜索是怎么做的
  • 深圳市设计网站公司自己做网站开网店
  • 智能建站cms管理系统修改wordpress时区
  • 站长怎么添加网站内容重庆网站推
  • 东莞网站建设属于什么专业网页设计代码书
  • 网站后台代码在哪修改wordpress添加搜索小工具
  • 爱站站长工具中国建设监理协会官方网站
  • 珠海微信网站开发东莞网站制作方案定制
  • 大学网站建设说明书记的网站域名
  • 网站如何开通支付功能第一ppt课件免费下载官网
  • 做1元夺宝网站挣钱吗美工网站设计收费
  • 华侨城网站开发wordpress页码颜色