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

网站续费贵是重新做个好还是续费mvc做门户网站

网站续费贵是重新做个好还是续费,mvc做门户网站,大连建设工程网站,系统总裁文章目录 一、206.反转链表二、92.反转链表 ||三、25. K 个一组翻转链表 一、206.反转链表 class Solution { public://使用头插//三个指针也可以ListNode* reverseList(ListNode* head) {if(headnullptr)return nullptr;ListNode* curhead;ListNode* newheadnew ListNode(0);L… 文章目录 一、206.反转链表二、92.反转链表 ||三、25. K 个一组翻转链表 一、206.反转链表 class Solution { public://使用头插//三个指针也可以ListNode* reverseList(ListNode* head) {if(headnullptr)return nullptr;ListNode* curhead;ListNode* newheadnew ListNode(0);ListNode* prenewhead;while(cur){ListNode* nextcur-next;cur-nextpre-next;pre-nextcur;curnext;}curnewhead-next;delete newhead;return cur;} };二、92.反转链表 || 给你单链表的头指针 head 和两个整数 left 和 right 其中 left right 。请你反转从位置 left 到位置 right 的链表节点返回 反转后的链表 /更简洁 class Solution { public:ListNode *reverseBetween(ListNode *head, int left, int right) {ListNode *dummy new ListNode(0, head), *p0 dummy;for (int i 0; i left - 1; i)p0 p0-next;ListNode *pre nullptr, *cur p0-next;for (int i 0; i right - left 1; i) {ListNode *nxt cur-next;cur-next pre; // 每次循环只修改一个 nextpre cur;cur nxt;}p0-next-next cur;p0-next pre;return dummy-next;} };// class Solution { // public://使用头插使用哨兵节点left可能为一 // ListNode* reverseBetween(ListNode* head, int left, int right) { // if(leftright) // { // return head; // } // int sign1; // ListNode* curhead; // ListNode* newheadnew ListNode(0); // ListNode* tmpnewhead; // ListNode* firstinsertnullptr; // while(cur) // { // ListNode* nextcur-next; // if(signleft) // { // firstinsertcur; // } // if(signleft signright) // { // cur-nexttmp-next; // tmp-nextcur; // curnext; // if(signright) // { // tmpfirstinsert; // if(curnullptr) // { // firstinsert-nextnullptr; // } // } // } // else // { // tmp-nextcur; // tmpcur; // curnext; // } // sign; // } // curnewhead-next; // delete newhead; // return cur; // } // };三、25. K 个一组翻转链表 给你链表的头节点 head 每 k 个节点一组进行翻转请你返回修改后的链表。 k 是一个正整数它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍那么请将最后剩余的节点保持原有顺序。 你不能只是单纯的改变节点内部的值而是需要实际进行节点交换。 class Solution { public://思路是进行头插ListNode *reverseKGroup(ListNode *head, int k) {//先遍历链表看需要反转几次int n0;ListNode* curhead;while(cur){curcur-next;n;}nn/k;//这就是要反转几次的结果curhead;ListNode* newheadnew ListNode(0);ListNode* prenewhead;for(int i0;in;i){ListNode* tmpcur;for(int i0;ik;i){ListNode* nextcur-next;cur-nextpre-next;pre-nextcur;curnext;}pretmp;}//处理不需要反转的pre-nextcur;curnewhead-next;delete newhead;return cur;} };
http://www.hkea.cn/news/14559201/

相关文章:

  • 烟台网站建设烟台用thinksns做的网站
  • 怎么给网站动态做伪静态wordpress xrea
  • 美塔基500元做网站可信吗怎么生成网站源代码
  • 做网站工商局要不要备案呢百度收录什么网站吗
  • wordpress建立移动站建网站 是否 数据库
  • 上海做网站去哪里基于h5的移动网站开发
  • 网站制作报价图片欣赏高端大气的网络公司名称
  • 山东seo网络推广苏宁网站优化与推广
  • 直接找高校研究生做网站行吗南昌建站模板
  • 单县网站开发江苏建设主管部门网站
  • 网站上线要多久做视频添加字幕的网站
  • 建设电瓶车官方网站it网站建设方案
  • 高校网站群建设方案wordpress编辑页面打开慢
  • 建站之家官网网站开发的推荐
  • 怎么用flash做游戏下载网站网站吸流量
  • 网站建设好怎么发布网站关键词优化排名软件
  • 好的案例展示网站wordpress 美化插件
  • 怎么将公司网站设成首页济南市住房与城乡建设厅网站
  • 英文网站建设 淮安无锡知名网站
  • 延吉制作网站怎么给自己做网站
  • 内销网站要怎么做专业网站设计制作优化排名
  • mysql 注册网站wordpress前端上传头像
  • 酒泉网站建设专家自己做传奇网站
  • 网站收录没排名城乡建设管理局网站
  • 网站建设对企业带来什么作用网站建设运营维护啥意思
  • 建网站需要什么人seo网站建设接单
  • 网站开发工具安卓版南京电商网站设计公司
  • 官方网站作用网站后台维护技能
  • 茂名网站建设解决方案wordpress设置文本编辑器
  • 广州服装 网站建设北京市中交建设有限公司网站