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

网站设计培训哪里好wordpress网站设密码错误

网站设计培训哪里好,wordpress网站设密码错误,wordpress mu,无锡做食品网站的公司1.单链表 线性表#xff1a;1.有限的序列 2.序列中的每一个元素都有唯一的前驱和后继#xff0c;除了开头和结尾的两个节点。 顺序表#xff1a;分配一块连续的内存去存放这些元素#xff0c;eg、数组 链表#xff1a;内存是不连续的#xff0c;元素会各自被分配一块内…1.单链表 线性表1.有限的序列 2.序列中的每一个元素都有唯一的前驱和后继除了开头和结尾的两个节点。 顺序表分配一块连续的内存去存放这些元素eg、数组 链表内存是不连续的元素会各自被分配一块内存内存和内存之间用指针进行相连。 顺序表和链表的区别是内存的连续与否 data域 | next指针域 —— data域 | next指针域 —— data域 | next指针域 —— NULL 单链表的操作 1.增加 1头插法 2尾插法 1插入—— data域 | next指针域 —— data域 | next指针域 —— data域 | next指针域 —— NULL 2data域 | next指针域 —— data域 | next指针域 —— data域 | next指针域 —— 插入——NULL 2.删除用前一个节点的指针直接指向对应节点的后一个节点的前驱只操作一个指针。 为了使操作方便在操作中添加一个头节点。头节点并不实际存储只保存链表中的元素个数。 代码实现 定义一个链表结构体 typedef struct Node {//定义一个结构体链表int data;//data域struct Node* next;//next指针 }Node;初始化一个链表 Node* initList() {//初始化一个链表Node* list (Node*)malloc(sizeof(Node));//给新节点开辟空间list-data 0;//data域list-next NULL;//next指针return list; } 头插法 void headInsert(Node* list,int data){//头插法 list是头节点 data域Node* node (Node*)malloc(sizeof(Node));//开辟空间定义一个新节点node-data data;//新节点的data域node-next list-next;//新节点的next指针等于原先链表的头指针的nextlist-next node;//原先头节点next指向新插入的头节点list-data;//代表当前链表之中插入元素 } 尾插法 void tailInsert(Node* list, int data){//尾插法Node* head list;//头指针为定义的list头节点Node* node (Node*)malloc(sizeof(Node));//定义新节点开辟空间node-data data;//新节点的data域等于原先链表头节点的data域 node-next NULL;//尾插的新节点next为空list list-next;//原先头节点往后延续while (list-next) {//判断是否到了最后list list-next;}list-next node;//先将头节点指针指向最后 头节点的下一个等于新插入的node节点head-data; } 删除 void Delete(Node* list, int data){//删除Node* head list;Node* pre list;Node* current list-next;list list-next;while (current)//循环遍历到最后{if (current-data data)//判断与删除元素是否相等{pre-next current-next;free(current);//删除结点break;//找到则跳出循环}pre current;//向下遍历current current-next;}list-data--; } 遍历操作 void printList(Node* list) {//遍历操作list list-next;//向后遍历while (list)//判空循环{printf(%d , list-data);list list-next;}printf(\n); } main函数 int main() {Node* list initList();headInsert(list, 1);headInsert(list, 2);headInsert(list, 3);headInsert(list, 4);headInsert(list, 5);tailInsert(list, 6);tailInsert(list, 7);tailInsert(list, 8);tailInsert(list, 9);tailInsert(list, 10);printList(list);Delete(list, 5);printList(list);Delete(list, 10);printList(list);Delete(list, 6);printList(list);return 0; } 整体函数 typedef struct Node {//定义一个结构体int data;struct Node* next; }Node;Node* initList() {//初始化一个链表Node* list (Node*)malloc(sizeof(Node));list-data 0;list-next NULL;return list; }void headInsert(Node* list,int data){//头插法Node* node (Node*)malloc(sizeof(Node));node-data data;node-next list-next;list-next node;list-data;//代表当前链表之中插入元素 }void tailInsert(Node* list, int data){//尾插法Node* head list;Node* node (Node*)malloc(sizeof(Node));node-data data;node-next NULL;list list-next;while (list-next) {list list-next;}list-next node;head-data; }void Delete(Node* list, int data){//删除Node* head list;Node* pre list;Node* current list-next;list list-next;while (current){if (current-data data){pre-next current-next;free(current);break;}pre current;current current-next;}list-data--; }void printList(Node* list) {//遍历操作list list-next;while (list){printf(%d , list-data);list list-next;}printf(\n); }int main() {Node* list initList();headInsert(list, 1);headInsert(list, 2);headInsert(list, 3);headInsert(list, 4);headInsert(list, 5);tailInsert(list, 6);tailInsert(list, 7);tailInsert(list, 8);tailInsert(list, 9);tailInsert(list, 10);printList(list);Delete(list, 5);printList(list);Delete(list, 10);printList(list);Delete(list, 6);printList(list);return 0; } 运行结果
http://www.eeditor.cn/news/124916/

相关文章:

  • 怎么改网站域名wordpress改域名修改哪里
  • 湖南住房和城乡建设网门户网站WordPress价格高低排序
  • 陶艺品网站模板app下载网址
  • 济南网站建设免费做牛排的网站
  • 河南网站建设优化技术网络营销策略理论
  • 中企动力网站建设iis7 无法访问此网站
  • 餐厅网站建设信息化工作总结 网站建设
  • 那个网站做外贸好长沙铭万做网站
  • 广州白云网站建设公司eclipse做企业网站
  • 柯桥做网站建设网站书籍
  • 企业网站建设联系方式广州外贸网站制作
  • linux建设网站php打开提示404wordpress会议
  • 无障碍网站建设成都网站推广创新互联
  • 赤峰建设银行网站昆明做网站的网络公司
  • 网站备案名字vultr搭建wordpress
  • 哈尔滨网络科技公司做网站深圳市企业网站seo联系方式
  • 做网站站长开通vip电商开放平台
  • 重庆市建设银行网站首页以下属于购物搜索广告的是
  • 织梦网站地图模板修改添加网站栏目的步骤
  • 网络网站建设办公河南城乡建设部网站首页
  • 做旅行攻略的网站怎么做视频网站赚钱吗
  • 经典网站设计作品江西省住房建设部官方网站
  • 自建国际网站做电商网站建设栏目结构表
  • 西安网站建设 招聘应聘ui设计师自我介绍
  • 素材下载网站中国建筑人力资源管理信息系统
  • 宣传网站建设实践报告找培训班一般在什么平台
  • 北京通信管理局网站备案哪些网站可以做相册视频
  • 旅游门户网站建设免费建购物网站
  • 网站建设与管理初级教学比较好的家装设计网站
  • 做微商货源网站赚钱吗文明网站建设总结