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

做网站设计管理需要什么知识多用户自助建站系统

做网站设计管理需要什么知识,多用户自助建站系统,企业综合信息管理系统,可以加速网页的加速器本文主要探讨单链表与双链表相关知识。 linux内核链表(include/linux/list.h) 内核链表中纯链表封装,纯链表的各种操作函数#xff08;节点创建、插入、删除、遍历#xff09;,纯链表内嵌在驱动结构体中,实现驱动的创建、插入、删除、遍历等 单链表 单链表链表头插…本文主要探讨单链表与双链表相关知识。 linux内核链表(include/linux/list.h)         内核链表中纯链表封装,纯链表的各种操作函数节点创建、插入、删除、遍历······,纯链表内嵌在驱动结构体中,实现驱动的创建、插入、删除、遍历等 单链表  单链表链表头插入节点,尾插入节点,删除节点,逆序 代码示例: #include stdio.h #include stdlib.hstruct node {int data;struct node *next; };//创建节点 struct node * create_node(int data) {struct node *p (struct node *)malloc(sizeof(struct node));if(p NULL){printf(malloc error\n);return NULL;}p-data data;p-next NULL;return p; }//头部插入节点 void insert_head(struct node *phead,struct node *new) {struct node *p phead;if(p NULL)exit(0);new-next p-next;p-next new;(phead-data); //头节点存储节点数量 }//尾部插入 void insert_tail(struct node *phead,struct node *new) {struct node *p phead;if(p NULL)exit(0);while(p-next ! NULL){p p-next;}p-next new;(phead-data); //头节点存储节点数量 }//遍历链表 void printf_link(struct node *phead) {if(phead NULL)exit(0);struct node *p phead;printf(num of struct : %d \n,p-data);while(p-next ! NULL){p p-next;printf(struct data : %d\n,p-data);} }//删除节点 int delete_node(struct node *phead,int data) {if(phead NULL)exit(-1);struct node *p phead;struct node *prev NULL;while(p-next ! NULL){prev p;p p-next;if(p-data data){if(p-next ! NULL){prev-next p-next; //其他节点free(p);}else{prev-next NULL; //尾节点free(p);}(phead-data)--;return 0;}}printf(have no data\n);return -1; }//链表逆序 void reserve_link(struct node *phead) {if(phead NULL)exit(-1);struct node *p phead-next;struct node *back NULL;struct node *prev NULL;if(p-next NULL || p NULL) //只有一个节点,不逆序return ;while(p-next ! NULL) //两个及两个以上节点{back p-next; //保存链表的下一个节点,由于头插逆序法插入节点与后面节点断开if(p phead-next) //第一个节点指向NULL作为逆序首节点{p-next NULL;}else{p-next phead-next;}phead-next p;p back;}insert_head(phead,p); //最后一个节点插入到链表,由于最后一个节点指向NULL,while判断失效(phead-data)--; //头插最后一个节点时,默认新增一个节点 }int main() {//创建头节点struct node *head create_node(0);//头部插入节点insert_head(head,create_node(1));insert_head(head,create_node(2));insert_head(head,create_node(3));insert_head(head,create_node(4));insert_head(head,create_node(5));//尾部插入节点insert_tail(head,create_node(1));insert_tail(head,create_node(2));insert_tail(head,create_node(3));insert_tail(head,create_node(4));insert_tail(head,create_node(5));//遍历节点printf_link(head);//删除节点delete_node(head,5);delete_node(head,5);delete_node(head,4);//遍历节点printf_link(head);//链表逆序reserve_link(head);//遍历节点printf_link(head);return 0; } 结果示例: 双链表 双链表尾插入,头插入,删除节点,前向遍历,后向遍历  代码示例: #include stdio.h #include stdlib.hstruct node {int data;struct node *next;struct node *prev; };//创建节点 struct node * create_node(int data) {struct node *p (struct node *)malloc(sizeof(struct node));if(p NULL){printf(malloc error\n);return NULL;}p-data data;p-next NULL;p-prev NULL;return p; }//头部插入节点 void insert_head(struct node *phead,struct node *new) {struct node *p phead;if(p NULL)exit(0);new-next p-next;if(p-next ! NULL)p-next-prev new;p-next new;new-prev p;(phead-data); //头节点存储节点数量 }//尾部插入 void insert_tail(struct node *phead,struct node *new) {struct node *p phead;if(p NULL)exit(0);while(p-next ! NULL){p p-next;}p-next new;new-prev p;new-next NULL;(phead-data); //头节点存储节点数量 }//后项遍历链表 void next_printf_link(struct node *phead) {if(phead NULL)exit(0);struct node *p phead;printf(num of struct : %d \n,p-data);while(p-next ! NULL){p p-next;printf(struct data : %d\n,p-data);} }//前项遍历链表 void prev_printf_link(struct node *phead) {if(phead NULL)exit(0);struct node *p phead;printf(num of struct : %d \n,p-data);while(p-next ! NULL){p p-next;}while(p-prev ! NULL){printf(struct data : %d\n,p-data);p p-prev;} }//删除节点 int delete_node(struct node *phead,int data) {if(phead NULL)exit(-1);struct node *p phead;struct node *test NULL;while(p-next ! NULL){p p-next;if(p-data data){if(p-next NULL){p-prev-next NULL; //尾节点}else{//其他节点p-prev-next p-next;p-next-prev p-prev;}free(p);(phead-data)--;return 0;}}printf(have no data\n);return -1; }int main() {//创建头节点struct node *head create_node(0);//头部插入节点insert_head(head,create_node(1));insert_head(head,create_node(2));insert_head(head,create_node(3));insert_head(head,create_node(4));insert_head(head,create_node(5));//尾部插入节点insert_tail(head,create_node(1));insert_tail(head,create_node(2));insert_tail(head,create_node(3));insert_tail(head,create_node(4));insert_tail(head,create_node(5));//遍历节点next_printf_link(head);//删除节点delete_node(head,2);delete_node(head,5);delete_node(head,4);//next遍历节点next_printf_link(head);//prev遍历节点prev_printf_link(head);return 0; } 结果示例:
http://www.w-s-a.com/news/555810/

相关文章:

  • 网站分几种access做网站数据方法
  • 网站默认图片s001网站建设公司
  • 淘宝的电子商务网站的建设东莞哪里有网站制作公司
  • 西安网站制作怎么联系wordpress登陆界面打开慢
  • 高端工作网站网站推广seo代理
  • 一般找素材都是做哪几个网站呢推广引流工具
  • 必须做网站等级保护html网页设计题库
  • 移动端网站开发 float手机在线建网站
  • 教育网站模板下载做汽车网站开题报告的意义
  • 网站首页做后台链接昌平网站制作
  • 营销型门户网站建设浏览器下载免费大全
  • 快三网站开发推广普通话手抄报内容50字
  • 沈阳专业做网站开发公司asp网站搭建教程
  • 网站建设代码福州小程序开发平台
  • 了解做房产广告的网站手机版官方网站的建设
  • 如何与别的网站做友情链接做网站排名大概要多少钱
  • 东莞市锂电池网站建设HTML5怎么做自适应网站
  • 江苏城乡建设学校网站群晖建立wordpress
  • wordpress导入网站模板seo自学网官网
  • 购物网站服务器带宽北京网站开发周期
  • 同性做视频网站网站怎么添加栏目
  • 新余网站设计seo自学网站
  • 新乡个人网站建设价格wordpress数据插件
  • 你是网站设计有限公司的项目经理网站推广的重要性
  • 网站定制开发怎么写泸州设计公司有哪些
  • 上海网站建设zj kt迅速编程做网站
  • 郑州服装 网站建设网站栏目合理性
  • 平面设计在线网站最新汽油价格调整最新消息
  • 刷单网站建设wordpress缩略图 裁剪
  • 视差 网站泰州公司做网站