From 28bfb0c2a5eaf33f4300f63b465cea93ae61b6e5 Mon Sep 17 00:00:00 2001 From: Haoping Date: Sun, 23 May 2021 13:16:35 +0300 Subject: [PATCH] =?UTF-8?q?Update=20Leetcode=20=E9=A2=98=E8=A7=A3=20-=20?= =?UTF-8?q?=E9=93=BE=E8=A1=A8.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add an additional explanation on how to spot out intersectional nodes --- notes/Leetcode 题解 - 链表.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/Leetcode 题解 - 链表.md b/notes/Leetcode 题解 - 链表.md index dd125c48..69a8f905 100644 --- a/notes/Leetcode 题解 - 链表.md +++ b/notes/Leetcode 题解 - 链表.md @@ -66,7 +66,7 @@ public ListNode getIntersectionNode(ListNode headA, ListNode headB) { 如果只是判断是否存在交点,那么就是另一个问题,即 [编程之美 3.6]() 的问题。有两种解法: - 把第一个链表的结尾连接到第二个链表的开头,看第二个链表是否存在环; -- 或者直接比较两个链表的最后一个节点是否相同。 +- 或者直接比较两个链表的最后一个节点是否相同。遍历两个链表,同时记录长度len1和len2,让长链表先走abs(len2-len1)步,再一起走至相同节点。 ## 2. 链表反转