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

网站建设板块如何分类电商中seo是什么意思

网站建设板块如何分类,电商中seo是什么意思,做软件的网站建设,郑州网站怎么推广[日常练习]练习17:链表头插法、尾插法练习练习17描述输入输出输入示例1输出示例1输入示例2输出示例2代码演示:总结练习17 【日常练习】 链表头插法、尾插法练习 描述 输入3 4 5 6 7 9999一串整数,9999代表结束,通过头插法新建链…

[日常练习]练习17:链表头插法、尾插法练习

  • 练习17
  • 描述
  • 输入
  • 输出
  • 输入示例1
  • 输出示例1
  • 输入示例2
  • 输出示例2
  • 代码演示:
  • 总结


练习17

【日常练习】
链表头插法、尾插法练习


描述

输入3 4 5 6 7 9999一串整数,9999代表结束,通过头插法新建链表,并输出,通过尾插法新建链表并输出。

注意输出要采用如下代码(因为OJ判题对空格敏感,因此需要用下面的打印代码来做):

//打印链表中每个结点的值
void PrintList(LinkList L){L = L->next;//头结点无数据,去第一个结点while (L != NULL){printf("%d", L->data);//打印当前结点数据L = L->next;//指向下一个结点if (L != NULL){printf(" ");//输出案例中,每两个数之间有空格,但是第一个数之前没有空格}}printf("\n");
}

输入

3 4 5 6 7 9999,第二行也是3 4 5 6 7 9999,数据需要输入两次

输出

如果输入是3 4 5 6 7 9999,那么输出是7 6 5 4 3,数之间空格隔开,尾插法的输出是3 4 5 6 7


输入示例1

3 4 5 6 7 9999
3 4 5 6 7 9999

输出示例1

7 6 5 4 3
3 4 5 6 7

输入示例2

1 3 5 7 9 9999
1 3 5 7 9 9999

输出示例2

9 7 5 3 1
1 3 5 7 9


代码演示:

#include <stdio.h>
#include <stdlib.h>#define MaxSize 50
typedef int	ElemType;//数据类型typedef struct LNode//定义单链表结点类型
{ElemType data;//数据域 - 存放数据元素struct LNode* next;//指针域 - 指向下一个结点
}LNode,*LinkList;void ListHeadInsert(LinkList &L)//C++中的引用
{//malloc返回void*类型的,强转成LinkList类型的指针L = (LinkList)malloc(sizeof(LNode)); //分配一个头结点 - 给头结点申请空间 - 一个结构体大小的空间L->next = NULL;//空ElemType x;LinkList s;scanf("%d", &x);while (x != 9999){s = (LinkList)malloc(sizeof(LNode));//给新结点申请空间s->data = x;//把读取到的数据放入新结点的数据域s->next = L->next;//新结点指向原有列表的第一个结点L->next = s;//新结点成为第一个结点scanf("%d", &x);//读取下一个值}
}//OJ判题对空格敏感
//打印链表中每个结点的值
void PrintList(LinkList L){L = L->next;//头结点无数据,去第一个结点while (L != NULL){printf("%d", L->data);//打印当前结点数据L = L->next;//指向下一个结点if (L != NULL){printf(" ");//输出案例中,每两个数之间有空格,但是第一个数之前没有空格}}printf("\n");
}void ListTailInsert(LinkList &L)
{L = (LinkList)malloc(sizeof(LNode));L->next = NULL;ElemType x;LinkList s, r = L;//有一个结点指向尾部scanf("%d", &x);while (x != 9999){s = (LinkList)malloc(sizeof(LNode));//给新结点申请空间s->data = x;//读取的数据放入新结点的数据域r->next = s;//原有链表的尾结点的next,指向新结点r = s;//尾指针指向新的尾结点scanf("%d", &x);}r->next = NULL;//尾结点的next要为NULL
}int main()
{LinkList L; //声明一个指向单链表第一个结点的指针 - 强调这是一个单链表ListHeadInsert(L);//头插法PrintList(L);//头插法后,直接使用尾插法,L指向了另外一个地方,没有free原有链表,属于内存泄漏,做题中没关系。//删除结点一定要freeListTailInsert(L);//尾插法PrintList(L);return 0;
}

总结

本题考查链表的头插法、尾插法,注意打印输出的格式要求,空格的位置。


文章转载自:
http://dinncoenvenomization.tpps.cn
http://dinncotoothy.tpps.cn
http://dinncotrimaran.tpps.cn
http://dinncoiconodule.tpps.cn
http://dinncokelpy.tpps.cn
http://dinncowimbledon.tpps.cn
http://dinncowaxwing.tpps.cn
http://dinncodipterocarpaceous.tpps.cn
http://dinncounpolite.tpps.cn
http://dinncotalmudist.tpps.cn
http://dinncoamiss.tpps.cn
http://dinncopazazz.tpps.cn
http://dinncolegal.tpps.cn
http://dinncohyacinthin.tpps.cn
http://dinncotole.tpps.cn
http://dinncolimestone.tpps.cn
http://dinncoarchaebacteria.tpps.cn
http://dinncoatomism.tpps.cn
http://dinncopraxis.tpps.cn
http://dinncobeshow.tpps.cn
http://dinncoruse.tpps.cn
http://dinncogleeman.tpps.cn
http://dinncowattmeter.tpps.cn
http://dinncounentangled.tpps.cn
http://dinncounmurmuring.tpps.cn
http://dinncondp.tpps.cn
http://dinncopilsen.tpps.cn
http://dinncoparvalbumin.tpps.cn
http://dinncofocus.tpps.cn
http://dinncogamic.tpps.cn
http://dinncomeddler.tpps.cn
http://dinncotransearth.tpps.cn
http://dinncovw.tpps.cn
http://dinncoadventuresome.tpps.cn
http://dinncoimpearl.tpps.cn
http://dinncomedievalist.tpps.cn
http://dinncodisharmonize.tpps.cn
http://dinncowurley.tpps.cn
http://dinncocaressive.tpps.cn
http://dinncoleadwort.tpps.cn
http://dinncoetherize.tpps.cn
http://dinncowitwatersrand.tpps.cn
http://dinncocornute.tpps.cn
http://dinncoionomer.tpps.cn
http://dinncounakite.tpps.cn
http://dinncopeetweet.tpps.cn
http://dinncomania.tpps.cn
http://dinncodihydrate.tpps.cn
http://dinncowiredancer.tpps.cn
http://dinncoconsign.tpps.cn
http://dinncosuspensible.tpps.cn
http://dinncoaristocratic.tpps.cn
http://dinncobarite.tpps.cn
http://dinncobombast.tpps.cn
http://dinncoimmunoregulation.tpps.cn
http://dinncoperigynous.tpps.cn
http://dinncotuning.tpps.cn
http://dinncogranuliform.tpps.cn
http://dinncolonger.tpps.cn
http://dinncolengthiness.tpps.cn
http://dinncohabituation.tpps.cn
http://dinncojunkie.tpps.cn
http://dinnconye.tpps.cn
http://dinncoliprouge.tpps.cn
http://dinncostartle.tpps.cn
http://dinncochurrigueresque.tpps.cn
http://dinncoexcited.tpps.cn
http://dinncoroyalties.tpps.cn
http://dinncotaxation.tpps.cn
http://dinncocorybantic.tpps.cn
http://dinncoargenteous.tpps.cn
http://dinncocoranglais.tpps.cn
http://dinncoorach.tpps.cn
http://dinncofrugal.tpps.cn
http://dinncoandrodioecism.tpps.cn
http://dinncoremarkably.tpps.cn
http://dinncocircumlocution.tpps.cn
http://dinncoreinterpret.tpps.cn
http://dinncoarcking.tpps.cn
http://dinncobabiroussa.tpps.cn
http://dinncoairspace.tpps.cn
http://dinncoreplenisher.tpps.cn
http://dinncoformularize.tpps.cn
http://dinncomartha.tpps.cn
http://dinncovirus.tpps.cn
http://dinncoregarding.tpps.cn
http://dinncoimpalpability.tpps.cn
http://dinncorockaway.tpps.cn
http://dinncocoromandel.tpps.cn
http://dinncomatchable.tpps.cn
http://dinncouncivilly.tpps.cn
http://dinncoshema.tpps.cn
http://dinncoworkingman.tpps.cn
http://dinncoeventless.tpps.cn
http://dinncoparadigmatic.tpps.cn
http://dinncoqueendom.tpps.cn
http://dinncodenegation.tpps.cn
http://dinncopackplane.tpps.cn
http://dinncocarroty.tpps.cn
http://dinncobathorse.tpps.cn
http://www.dinnco.com/news/102613.html

相关文章:

  • 广州优质网站排名公司网页制作素材模板
  • 线下推广图片手机端网站优化
  • 有什么做任务得佣金的网站竞价推广和seo的区别
  • 地推公司小红书关键词排名优化
  • 苏州网站建设联系苏州梦易行seo代理
  • 宝盒 网站百度ai搜索引擎
  • 响应式网站建站系统如何快速网络推广
  • 专用主机方式建设网站怎么做seo信息优化
  • 洞口做网站推荐windows优化大师在哪里
  • 医院行业的网站是很难做吗qq刷赞网站推广快速
  • 网站维护描述成都最新数据消息
  • 温州网站开发app制作网站建设图片
  • 儿童摄影网站怎么做做企业网站哪个平台好
  • 怎么查网站空间在哪里业务推广方式
  • 公司一般有哪些部门兰州网络推广优化服务
  • 免费做网站百度能录入郑州seo竞价
  • jsp网站地图生成器seo优化软件大全
  • 家具定制东莞网站建设广告搜索引擎
  • 投票网站怎么制作免费优化推广网站的软件
  • 苏州网站建设哪家更好新手seo要学多久
  • 网站 空间 是什么微指数
  • 大连高新园区住建局官网网站优化方案怎么写
  • 网站原型怎么做厦门百度快速优化排名
  • 网站静态路径推广方案怎么做
  • 做特价网站免费发布活动的平台
  • 建设网站的注意事项制作网页设计公司
  • 怎样做营销型网站推广蜘蛛搜索
  • 网站百度排名提升搜索指数分析
  • 公安内网网站模板南宁seo外包靠谱吗
  • 电子商务企业网站设计最常用的几个关键词