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

iis 发布网站内部服务器错误建e网模型

iis 发布网站内部服务器错误,建e网模型,国产最好的a级suv,商城网站备案流程问题描述 RT. 解决思路 (1) 两链表都是单向链表#xff1a;判断两链表的末尾节点是否相同#xff1b; (2) 两链表中一个有环#xff0c;一个没环#xff1a;不可能相交#xff1b; (3) 两链表都有环#xff1a;slow-fast双指针方法。 程序 public class ListIntersection…问题描述 RT.   解决思路 (1) 两链表都是单向链表判断两链表的末尾节点是否相同 (2) 两链表中一个有环一个没环不可能相交 (3) 两链表都有环slow-fast双指针方法。   程序   public class ListIntersection {// two single listpublic boolean isIntersectionOfTwoSingleList(ListNode l1, ListNode l2) {if (l1 null || l2 null) {return false;}// whether the end of two list is sameListNode endOfList1 getEndOfList(l1);ListNode endOfList2 getEndOfList(l2);return endOfList1 endOfList2;}private ListNode getEndOfList(ListNode head) {if (head null) {return null;}ListNode node head;while (node.next ! null) {node node.next;}return node;}// two list with cyclepublic boolean isIntersectionOfTwoListWithCycle(ListNode l1, ListNode l2) {if (l1 null || l2 null) {return false;}ListNode slow l1, fast l2;while (fast.next ! null || fast ! null || slow ! null) {slow slow.next;fast fast.next.next;if (slow fast) {return true;}}return false;} }Follow up 求出两个链表相交的第一个节点如果存在的话。   (1) 两条单链表 a. 求出两条链表的长度及长度之差diff然后设立两个指针指向两链表的头结点其中指向长链表头结点的指针向前移动diff步 b. 然后同时移动两指针直到所指节点相同地址相同为止否则返回null。   (2) 两条链表有环 首先slow-fast直到相遇为止其中任意一个指针指回其头结点然后slow和fast指针同时移动直到相遇相遇的节点为第一个相交的节点。 注意可能有两个相交的节点   程序 public class ListIntersection2 {// two single listpublic ListNode getFirstIntersectionNodeOfSingleList(ListNode l1,ListNode l2) {ListNode longNode l1, shortNode l2;int len1 getLenOfList(l1);int len2 getLenOfList(l2);if (len1 len2) {longNode l2;shortNode l1;}int diff Math.abs(len1 - len2);// long move diff stepswhile (diff 0) {longNode longNode.next;--diff;}while (longNode ! null shortNode ! null) {if (longNode shortNode) {return longNode;}longNode longNode.next;shortNode shortNode.next;}return null;}private int getLenOfList(ListNode head) {ListNode node head;int len 0;while (node ! null) {len;node node.next;}return len;}// two list with cyclepublic ListNode getFirstIntersectionNodeOfCycleList(ListNode l1, ListNode l2) {if (l1 null || l2 null) {return null;}ListNode slow l1, fast l2;while (fast.next ! null || fast ! null || slow ! null) {if (fast slow) {break;}slow slow.next;fast fast.next.next;}if (fast null || slow null) {return null;}slow l1;while (slow ! fast) {slow slow.next;fast fast.next;}return slow;} }转载于:https://www.cnblogs.com/harrygogo/p/4614277.html
http://wiki.neutronadmin.com/news/118849/

相关文章:

  • 如何建立网站销售平台网址的域名
  • 企业网站关键词应如何优化网页设计答辩问题及答案
  • 做淘宝客要自己的网站怎么快速做网站排名
  • 网站建设与服务费是什么服务三亚专业网站建设
  • 做网站关键词wordpress 固定链接插件
  • 高校网站建设的文章wordpress模板是什么
  • 青岛哪家做网站好网站开发全栈工程师技能图
  • 找事情做的网站河南平台网站建设价位
  • 中山做营销型网站公司标志空间网站
  • 河南网站建设定制node.js做网站
  • 镇海企业建站连云港东海县做网站
  • 网站的代运营网站后台文章编辑器
  • 官方购物网站正品深圳公司注册地址新规定
  • 自己建商城型网站做餐饮培训网站广告
  • 买了空间和域名 怎么做网站简洁中文网站模板下载
  • 中国建设管理信息网站怎样在设计网站做图赚钱吗
  • 眉山住房和城乡建设局网站电子商务平台中搜索词拆解包括
  • 宽带技术网网站佛山中小企业网站制作
  • 雄县没有做网站的公司网站建设及优化 赣icp
  • 小企业网站建设的连接方式家用电器网站建设
  • 墨刀怎么做网站wordpress修改字体加载
  • 邯郸网站设计应搜韦欣cidun8上词什么叫网站后台
  • 广州企业网站建设哪家服务好万峰科技著.asp.net网站开发四酷全书电子工业出版社
  • 仿爱奇艺网站源码免费做苗木的网站
  • 河南做网站联系电话学历提升报名
  • 柳州网站建设哪里有logo设计的最好的公司
  • 企业宣传册免费模板网站广西注册公司网站
  • 毕设做网站太简单外贸怎么入行
  • 无法连接wordpress站点做洗化的网站
  • 最好设计网站建设wordpress 暗箱