We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 31bb28f commit c955ab2Copy full SHA for c955ab2
Contents/02.Linked-List/03.Linked-List-Two-Pointers/01.Linked-List-Two-Pointers.md
@@ -14,7 +14,7 @@
14
15
- 使用两个指针 `slow`、`fast`。`slow`、`fast` 都指向链表的头节点,即:`slow = head`,`fast = head`。
16
- 先将快指针向右移动 `n` 步。然后再同时向右移动快、慢指针。
17
-- 等到快指针移动到链表尾部(即 `fast == Node`)时跳出循环体。
+- 等到快指针移动到链表尾部(即 `fast == None`)时跳出循环体。
18
19
### 2.2 起点不一致的快慢指针伪代码模板
20
@@ -117,7 +117,7 @@ while fast and fast.next:
117
118
- 使用两个指针 `slow`、`fast`。`slow`、`fast` 都指向链表的头节点。
119
- 在循环体中将快、慢指针同时向右移动。其中慢指针每次移动 `1` 步,即 `slow = slow.next`。快指针每次移动 `2` 步,即 `fast = fast.next.next`。
120
-- 等到快指针移动到链表尾部(即 `fast == Node`)时跳出循环体,此时 `slow` 指向链表中间位置。
+- 等到快指针移动到链表尾部(即 `fast == None`)时跳出循环体,此时 `slow` 指向链表中间位置。
121
- 返回 `slow` 指针。
122
123
#### 3.4.4 代码
0 commit comments