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

网站用哪个软件做企业门户网站代码设计

网站用哪个软件做,企业门户网站代码设计,网页视频下载插件哪个好用,wordpress博客广告收益链表常用技巧和操作总结 常用技巧 画图 引入虚拟头节点 不要吝啬空间#xff0c;大胆定义变量 快慢双指针常用操作 创建一个新节点 尾插 头插 两数相加 ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {int carry 0;ListNode* newHead new ListNode, *cur newHea…链表常用技巧和操作总结 常用技巧 画图 引入虚拟头节点 不要吝啬空间大胆定义变量 快慢双指针常用操作 创建一个新节点 尾插 头插 两数相加 ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) {int carry 0;ListNode* newHead new ListNode, *cur newHead;while (l1 ! nullptr l2 ! nullptr) {int num l1-val l2-val carry;carry num / 10;num num % 10;cur-next new ListNode(num);cur cur-next;l1 l1-next;l2 l2-next;}while (l1 ! nullptr) {int num l1-val carry;carry num / 10;num num % 10;cur-next new ListNode(num);cur cur-next;l1 l1-next;}while (l2 ! nullptr) {int num l2-val carry;carry num / 10;num num % 10;cur-next new ListNode(num);cur cur-next;l2 l2-next;}if (carry ! 0) {cur-next new ListNode(carry);}return newHead-next; }两两交换链表中的节点 ListNode* swapPairs(ListNode* head) {if (head nullptr || head-next nullptr) return head;ListNode *front head, *back front-next, *newHead new ListNode, *cur newHead;while (true) {cur-next back;ListNode* tmp back-next;back-next front;front-next tmp;cur front;if (tmp ! nullptr tmp-next ! nullptr) {front tmp;back front-next;} else if (tmp ! nullptr tmp-next nullptr) {cur-next tmp;return newHead-next;} else {return newHead-next;}} }重排链表 ListNode* reverse(ListNode* head) {if (head nullptr || head-next nullptr) return head;ListNode* newHead reverse(head-next);head-next-next head;head-next nullptr;return newHead; } void reorderList(ListNode* head) {ListNode *slow head, *fast head;while (fast ! nullptr fast-next ! nullptr) {slow slow-next;fast fast-next-next;}ListNode* cur1 head, *cur2 reverse(slow);ListNode* newHead new ListNode, *cur newHead;while (cur1 ! cur2 cur2 ! nullptr) {cur-next cur1;cur1 cur1-next;cur cur-next;cur-next cur2;cur2 cur2-next;cur cur-next;} }合并 K 个升序链表 // 解法一 ListNode* mergeKLists(vectorListNode* lists) {// 小根堆priority_queueListNode*, vectorListNode*, Comp pq;for (ListNode* e : lists) {if (e ! nullptr) {pq.push(e);}}ListNode *newHead new ListNode, *cur newHead;while (!pq.empty()) {cur-next pq.top();cur cur-next;pq.pop();if (cur-next ! nullptr) {pq.push(cur-next);}}return newHead-next; }// 解法二 ListNode* merge_sort(vectorListNode* lists, int start, int end) {if (start end) return nullptr;else if (start end) return lists[start];int mid start (end - start) / 2;ListNode* left merge_sort(lists, start, mid);ListNode* right merge_sort(lists, mid 1, end);if (left nullptr) return right;else if (right nullptr) return left;ListNode *newHead new ListNode, *cur newHead;while (left ! nullptr right ! nullptr) {if (left-val right-val) {cur-next left;left left-next;} else {cur-next right;right right-next;}cur cur-next;}while (left ! nullptr) {cur-next left;left left-next;cur cur-next;}while (right ! nullptr) {cur-next right;right right-next;cur cur-next;}return newHead-next; } ListNode* mergeKLists(vectorListNode* lists) {return merge_sort(lists, 0, lists.size() - 1); }K 个一组翻转链表 ListNode* reverseKGroup(ListNode* head, int k) {int total 0;ListNode* cur head;while (cur ! nullptr) {total;cur cur-next;}ListNode* newHead new ListNode;cur newHead;while (head ! nullptr) {int count k;ListNode* tail head;if (total k) {while (count-- head ! nullptr) {ListNode* tmp head-next;head-next cur-next;cur-next head;head tmp;}total - k;}cur tail;if (total k) {cur-next head;break;}}return newHead-next; }
http://www.hkea.cn/news/14476520/

相关文章:

  • 网站建设需要掌握什么知识单页网站制作教程
  • 郑州企业网站排名优化方法企业网站seo成功案例
  • 哪些网站动效做的不错网页设计软件有哪些
  • 丽江门户网站网站建设行业背景
  • 怎样建立网站的快捷方式商务网站建设ppt
  • 软件发布网站源码wordpress建手机版目录6
  • 做网站公司大连wordpress一键排版
  • 手机网站模板设计软件湖南智慧住建云官网
  • 网站做系统下载如何设计自己的网页
  • 医保局微网站开发北京网页制作培训班
  • 邢台高端网站建设wordpress主页设置分类
  • 制作一个网站并上传访问wordpress企业网站制作视频教程
  • 建设网站有哪些问题个人建什么样的网站
  • 饰品 东莞网站建设网站建设骗子公司
  • wordpress网站被拒登网站建设与管理.pdf
  • 旅游网站建设市场分析网络营销有什么特点
  • 商丘网站建设推广公司地址网站2级页面怎么做
  • 检察 门户网站建设设计网站作品
  • 网站收录大幅度下降网站被k 多久恢复
  • 顺德哪家做网站淘宝联盟怎么推广赚钱
  • 网站怎样建设友情链接高性能的网站建设指南
  • 做小程序要有网站吗莱芜金点子信息港电子版
  • 网站模板找超速云建站网站虚拟建设策划
  • 河北专业信息门户网站定制陕西公路工程建设有限公司网站
  • 下载建设银行官方网站wordpress给分类页加关键词
  • 有限公司企业网站建设方案wordpress 安装教程
  • asp网站怎么做404页面import wordpress
  • 推广网站哪家做的好wordpress固定链接 重定向插件
  • 试玩网站设计建设企业网站建设需要提供什么材料
  • 营销网站建设费用页面设计术语