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

2021年新闻摘抄网站优化如何提高排名

2021年新闻摘抄,网站优化如何提高排名,湖南系统开发,自建网站 做自定义导航10 链表 一、链表是什么#xff1f; -- 数据的一种存储方式 -- 链式存储 #xff08;1#xff09;线性存储 -- 地址连续 -- 自动开辟#xff0c;自动释放 -- 默认是线性存储 #xff08;2#xff09;链式存储 -- 地址不连续…10 链表 一、链表是什么 --  数据的一种存储方式         -- 链式存储 1线性存储         -- 地址连续         -- 自动开辟自动释放         -- 默认是线性存储 2链式存储         -- 地址不连续         -- 手动开辟手动释放 二、链式存储所使用的常用函数 1、malloc 函数功能开辟内存空间 函数头文件#includestdlib.h 函数原型void *malloc(size_t size); 函数参数size -- 要开辟的空间大小 函数返回值void *         -- 开辟的空间的地址         -- 任意类型    -- 方便强转成你需要的类型 注因为返回值是任意类型所以一定不要忘记强转 2、perror 函数功能打印某个函数的执行结果错误信息 函数头文件#includestdio.h 函数原型void perror(const char *s); 函数参数 s -- 字符串函数名 //因为参数是个字符串类型所以函数名作为参数时要用引起来。 函数返回值无 3、memset 函数功能初始化内存空间 函数头文件#includestring.h 函数原型void *memset(void *s,int c,size_t n); 函数参数         s         -- 要初始化的空间地址         c         -- 初始化的内容 -- 一般初始化为0         n         -- 要初始化的空间大小 函数返回值不用 4、bzero 函数功能初始化内存空间为0 函数头文件#includestrings.h 函数原型void bzero(void *s,size_t n); 函数参数         s         -- 要初始化的空间地址         n         -- 要初始化的空间大小 函数返回值无 4、free 函数功能释放内存空间 --地址依然存在但是不能够使用 函数头文件#includestdlib.h 函数原型void free(void *ptr); 函数参数                 ptr -- 要释放的空间地址 函数返回值无 三、链表的存储形式 1、链表是由多个节点组成的 2、节点的组成 1保存数据                 -- 数据域 2保存下一个节点的地址                 -- 指针域 地址默认都是首地址 四、链表操作 tip: 在vscode中按住ctrl的同时点击鼠标就会产生超链接进到其函数定义处或者是.h文件里。 ctrlF有查询和替换的功能 1、创建节点 #include create.hstruct node *create() {struct node *p (struct node *)malloc(sizeof(struct node)); //要强转if(p NULL){perror(malloc); //参数是字符串所以函数名要用引起来return NULL;}memset(p-pnext,0,sizeof(p-data));//将数据初始化为0因为不能把指针初始化为0所以指针和数据分开初始化p-pnext NULL;printf(创建成功!\n);return p; } 2、新增链表 #include add.hstruct node *ADD(struct node *phead) {struct node *pnew create();printf(请输入你想增加的数据\n);scanf(%d,pnew-data);struct node *ptemp phead;while(ptemp-pnext ! NULL){ptemp ptemp-pnext;}ptemp-pnext pnew;printf(添加成功\n); }3、删除链表、修改、查询 1删除 注这里要ptemp代表的是要删除数据的上一个节点如果ptemp是要删除的节点的话则找不到上一个节点的数据。因为是单链表。 #include del.hvoid DEL(struct node *phead) {if(phead-pnext NULL){printf(链表为空\n);return;}int n;printf(请输入你想删除的数据:\n);scanf(%d,n);struct node *ptemp phead;while(ptemp-pnext !NULL){if(ptemp-pnext-data n){struct node *pdel ptemp-pnext;ptemp-pnext ptemp-pnext-pnext;free(pdel);printf(删除成功\n);return;}ptemp ptemp-pnext;}printf(查无数据\n); }(2)修改 #include update.hvoid UPDATE(struct node *phead) {if(phead-pnext NULL){printf(链表为空\n);return;}int n;printf(请输入你想更新的数据:\n);scanf(%d,n);struct node *ptemp phead;while(ptemp-pnext !NULL){if(ptemp-pnext-data n){printf(请输入您要修改的新数据\n);scanf(%d,ptemp-pnext-data);printf(更新成功\n);return;}ptemp ptemp-pnext;}printf(查无数据\n); }3查询 #include find.hvoid FIND(struct node *phead) {if(phead-pnext NULL){printf(链表为空\n);return;}int n;printf(请输入你想查询的数据:\n);scanf(%d,n);struct node *ptemp phead;while(ptemp-pnext !NULL){if(ptemp-pnext-data n){printf(%d\n,ptemp-pnext-data);printf(查询成功\n);return;}ptemp ptemp-pnext;}printf(查无数据\n); }4、遍历链表 注ptemp这里是第一个有效节点因为phead头节点没有数据域所以不是有效节点 #include query.hvoid QUERY(struct node *phead) {if(phead-pnext NULL){printf(链表为空\n);return;}struct node *ptemp phead-pnext;printf(链表存放的数据为\n);while(ptemp!NULL){printf(%d\n,ptemp-data);ptemp ptemp-pnext;} } 5、节点排序 五、循环链表 六、双向链表
http://www.hkea.cn/news/14442146/

相关文章:

  • 网站建设与管理学习什么优秀地方门户网站系统
  • 建设网站最重要的是什么西乡专业做网站公司
  • 网络推广网站排名成都科技网站建设联系
  • 佛山优化网站关键词网站seo置顶
  • 农村建设房子建设网站建设临沂画册设计公司
  • 制作视频网站开发wordpress输入密码查看内容
  • 网站如何做反爬wordpress登录cdn
  • 做网站 前端导航网站 win8风格
  • 中科 网站会员注册系统建设小说网站开发多少钱
  • 新乡搜狗网站推广工具制作网站需要哪些工具
  • 百度做的网站迁移什么是网络营销?网络营销的特点有哪些?
  • 做尽调需要用到的网站中美网站建设
  • 重庆网站制作公司多少钱网站如何优化排名软件
  • 门户网站开发要求尉氏做网站
  • 江门站官网淘宝网站建设图片素材
  • 9377手游交易平台成都网站优化常识
  • 网站开发 岗位职责搭网站要多少钱
  • 网站建设工作小组分工手机网站全屏
  • 淮安做网站app惊艳的网站
  • 天津站设计单位超好看WordPress
  • 帮人网站开发维护违法wordpress 翻译工具
  • 17网站一起做网店新塘个人网站制作的主要内容
  • 做网站江西网站首页title怎么修改
  • 免费wap自助建站系统宁波市江北区建设局网站
  • 化妆品网站建设说明徐州网站建设开发
  • 网站建设制度西安区seo搜索排名优化
  • 外贸人自己搭建外贸网站wordpress网站流量统计分析的维度包括
  • 网站seo优化技术入门淮安市做网站
  • 消防电气火灾监控系统网站开发网站建设导航栏变化
  • 我被钓鱼网站骗了骗取建设信用卡建设银行会怎么处理钱会还回吗如何建立免费微网站