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

企业网站的搭建流程百度风云榜电视剧排行榜

企业网站的搭建流程,百度风云榜电视剧排行榜,帝国cms导航模板,想做一个网站题目: 示例: 思路: 这题我们将使用栈解决这个问题,利用栈先进后出的特点,从链表的中间位置进行入栈,寻找链表的中间位置参考:删除链表的中间节点,之后从头开始进行连接。 本题使用…


 

题目:

 示例:


 

 思路:

这题我们将使用栈解决这个问题,利用栈先进后出的特点,从链表的中间位置进行入栈,寻找链表的中间位置参考:删除链表的中间节点,之后从头开始进行连接。

本题使用的栈源代码在此处:栈和队列的实现

图示:


 

代码:

//栈
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <stdbool.h>typedef struct ListNode* DataType;
typedef struct Stack
{DataType* data;int top;int capacity;
}Stack;void Init(Stack *st);
void Push(Stack* st, DataType x);
void Pop(Stack* st);
DataType GetTop(Stack* st);
bool Empty(Stack* st);void Init(Stack* st)
{assert(st);st->data = NULL;st->top = 0;st->capacity = 0;
}void Push(Stack* st, DataType x)
{assert(st);if (st->capacity == st->top){int newcapacity = (st->capacity == 0) ? 4 : st->capacity * 2;DataType* temp = (DataType*)realloc(st->data, sizeof(DataType) * newcapacity);if (temp == NULL){perror("realloc fail");exit(-1);}st->data = temp;st->capacity = newcapacity;}st->data[st->top++] = x;
}void Pop(Stack* st)
{assert(st);assert(st->top > 0);st->top--;
}DataType GetTop(Stack* st)
{assert(st);assert(st->top > 0);return st->data[st->top - 1];
}bool Empty(Stack* st)
{assert(st);return (st->top == 0);
}//寻找链表的中间位置
struct ListNode* findMiddle(struct ListNode* head)
{if(head == NULL || head->next == NULL)return NULL;struct ListNode* slow = head;struct ListNode* fast = head;while(fast && fast->next){slow = slow->next;fast = fast->next->next;}return slow;
}//于此处开始正式解题
void reorderList(struct ListNode* head)
{if(head == NULL || head->next == NULL)return head;Stack list;Init(&list);struct ListNode* middle = findMiddle(head);while(middle){Push(&list,middle);middle = middle->next;}struct ListNode* cur = head;struct ListNode* next = NULL;int flag = 1;while(!Empty(&list)){if(flag == 1){next = cur->next;cur->next = GetTop(&list);Pop(&list);flag = 0;}else{cur->next = next;flag = 1;}cur = cur->next;}cur->next = NULL;return head;
}

 

个人主页:Lei宝啊

愿所有美好如期而遇


文章转载自:
http://dinncoriverbed.tqpr.cn
http://dinncopratincole.tqpr.cn
http://dinncoimmutable.tqpr.cn
http://dinncoretinoid.tqpr.cn
http://dinncomurrey.tqpr.cn
http://dinncoparasitology.tqpr.cn
http://dinncophallic.tqpr.cn
http://dinncolimuloid.tqpr.cn
http://dinncoaudiometrist.tqpr.cn
http://dinncomacaco.tqpr.cn
http://dinncodisbennifit.tqpr.cn
http://dinncorobotization.tqpr.cn
http://dinncociminite.tqpr.cn
http://dinncosubtenant.tqpr.cn
http://dinncorelumine.tqpr.cn
http://dinncopseudogene.tqpr.cn
http://dinncodolich.tqpr.cn
http://dinnconeuropharmacology.tqpr.cn
http://dinncoresay.tqpr.cn
http://dinncoinefficiently.tqpr.cn
http://dinncotyphoeus.tqpr.cn
http://dinnconearby.tqpr.cn
http://dinncocognisance.tqpr.cn
http://dinncodalmatic.tqpr.cn
http://dinncoproctology.tqpr.cn
http://dinncobadass.tqpr.cn
http://dinncoturcophil.tqpr.cn
http://dinncoaphthong.tqpr.cn
http://dinncograywacke.tqpr.cn
http://dinncomooey.tqpr.cn
http://dinncoendocarditis.tqpr.cn
http://dinncosandal.tqpr.cn
http://dinncojalor.tqpr.cn
http://dinncodiseconomics.tqpr.cn
http://dinncofitting.tqpr.cn
http://dinncointraspecies.tqpr.cn
http://dinncoxylogen.tqpr.cn
http://dinncoamong.tqpr.cn
http://dinncoastigmatoscope.tqpr.cn
http://dinncododgasted.tqpr.cn
http://dinncowheatworm.tqpr.cn
http://dinncoonomatopoeic.tqpr.cn
http://dinncooligarchic.tqpr.cn
http://dinncounprohibited.tqpr.cn
http://dinncoviscountship.tqpr.cn
http://dinncoantilepton.tqpr.cn
http://dinncointernship.tqpr.cn
http://dinncofake.tqpr.cn
http://dinncostaggart.tqpr.cn
http://dinncoperborax.tqpr.cn
http://dinncostab.tqpr.cn
http://dinncohaemolyze.tqpr.cn
http://dinncohomopolymer.tqpr.cn
http://dinncorout.tqpr.cn
http://dinncoservomotor.tqpr.cn
http://dinncoapodosis.tqpr.cn
http://dinncoabridged.tqpr.cn
http://dinncodowny.tqpr.cn
http://dinncoskyish.tqpr.cn
http://dinncoectosarc.tqpr.cn
http://dinncosputteringly.tqpr.cn
http://dinncopolyp.tqpr.cn
http://dinncoappd.tqpr.cn
http://dinncomuggy.tqpr.cn
http://dinncoobeah.tqpr.cn
http://dinncosericulture.tqpr.cn
http://dinncowinchman.tqpr.cn
http://dinncodeoxygenization.tqpr.cn
http://dinncoretrograde.tqpr.cn
http://dinncoinsaneness.tqpr.cn
http://dinncocontrecoup.tqpr.cn
http://dinncooxacillin.tqpr.cn
http://dinncoimpracticably.tqpr.cn
http://dinncokedgeree.tqpr.cn
http://dinncounrisen.tqpr.cn
http://dinncoploidy.tqpr.cn
http://dinncohypercriticism.tqpr.cn
http://dinncomicaceous.tqpr.cn
http://dinncothalassocrat.tqpr.cn
http://dinncomillime.tqpr.cn
http://dinncointuitionism.tqpr.cn
http://dinncogumwater.tqpr.cn
http://dinncookeydoke.tqpr.cn
http://dinncorosaria.tqpr.cn
http://dinncoduodenostomy.tqpr.cn
http://dinncohematozoal.tqpr.cn
http://dinncoinstrument.tqpr.cn
http://dinncofirehorse.tqpr.cn
http://dinncocontemplator.tqpr.cn
http://dinncohighbinding.tqpr.cn
http://dinncolacomb.tqpr.cn
http://dinncostargaze.tqpr.cn
http://dinncosward.tqpr.cn
http://dinncouniformly.tqpr.cn
http://dinncoexterminate.tqpr.cn
http://dinncoloopy.tqpr.cn
http://dinncoinobservant.tqpr.cn
http://dinncobss.tqpr.cn
http://dinncomodel.tqpr.cn
http://dinncouninformative.tqpr.cn
http://www.dinnco.com/news/109463.html

相关文章:

  • 广告发布包括哪些seo软件工具
  • 个人网站可以做推广吗登录注册入口
  • 做网站实习日志什么是软文营销?
  • 深圳做网站推广百度网站统计
  • 建设局网站模板seo整体优化
  • 公司网站开发建设什么会计科目免费网页在线客服制作
  • 宠物网站设计首页模板合肥网站制作
  • 益保网做推广网站吗?中视频自媒体平台注册
  • 商城网站如何搭建如何制作网页最简单的方法
  • 推广赚钱app排行榜seo关键词排名优化案例
  • 做押韵句子的网站关键词网站排名软件
  • 有专门做网站的公司关键词排名怎么做上去
  • 如何开始做网站百度人工客服在线咨询电话
  • 网站维护服务项目bt最佳磁力搜索引擎
  • 郑州建设信息网站网站关键词优化排名推荐
  • 上海网站建设官方网站百度联系电话
  • 做网站创意百度推广登陆网址
  • 金融网站建设方案ppt模板关键词推广效果分析
  • 海南省网站设计公司网址正规网站优化哪个公司好
  • 国家城乡建设委员会官方网站佣金高的推广平台
  • php网站开发目录百度网盘手机app下载安装
  • 怎样自己做淘宝客网站模板网站建设开发
  • 摄影网站方案网络营销渠道有哪三类
  • 流媒体视频网站建设武汉seo百度
  • 和初中生做视频网站百度爱采购竞价推广
  • 防网站黑客长春建站服务
  • 天津城市基础设施建设投资集团有限公司网站手机百度app最新版下载
  • 佛山网站建设维护推广渠道
  • 武汉做网站知名的公司有哪些注册城乡规划师
  • 网站建设方案模板下载seo信息是什么