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

设计接活的网站一般做网站的软件

设计接活的网站,一般做网站的软件,河南建设部网站,wordpress托管 安装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;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); } 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.zqtcl.cn/news/665461/

相关文章:

  • 网站开发的需求文档大型网站外链是怎么建设的
  • 网站建设实训心得与建议网站建设一般需要多少费用
  • 国内怎么打开WordPress网站wordpress制作api文件路径
  • 义乌网站开发公司wordpress段子模板
  • 国外有没有专门做靶材的网站做网站用哪个电脑
  • 郑州网站制作郑州网站制作上海网站建设免费推荐
  • php电子商务网站开发建设企业网站都需要啥
  • 从零学做网站如何让客户做网站
  • 关于销售网站建设的短文菜单宣传网站怎么做
  • 学网站开发有前途吗淮南服装网站建设费用
  • 网站外包附近临时工500元一天
  • 国外做logo的网站深圳有哪些软件外包公司
  • 网站加载流量一键生成app软件下载
  • 如何建设网站知乎襄阳做网站公司哪家好
  • 用ai怎么做网站专门做短视频的公司
  • 陶瓷类网站建设免费会员管理软件
  • 网站建设 用户管理一个服务器多个网站好吗
  • php做网站特效wordpress开启xmlrppc
  • 顺义重庆网站建设纪检监察网站建设
  • 网站制作源码企业品牌推广方式有哪些
  • 简述制作网站的流程网站开发后端用什么
  • 长沙好的网站建设公司厦门建网站多少钱
  • wordpress id清0中山网站的优化
  • 泰州网站制作维护服务器调用wordpress
  • 网站建设飠金手指下拉c 网站开发 环境配置
  • 派点网站建设物流公司做网站哪家好
  • 最便宜的外贸自建站平台wordpress 主题 mip
  • wordpress动漫视频网站黄冈网站推广策略
  • 做推广的网站带宽需要多少钱asp网站防攻击
  • 网站企业wordpress需要php几