Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4c080d2

Browse files
authored
Update 几道常见的链表算法题.md
1 parent 18a4dea commit 4c080d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎docs/dataStructures-algorithms/几道常见的链表算法题.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public class Solution {
324324
**进阶——一次遍历法:**
325325

326326

327-
> **链表中倒数第N个节点也就是正数第(L-N+1)个节点。
327+
> 链表中倒数第N个节点也就是正数第(L-N+1)个节点。
328328
329329
其实这种方法就和我们上面第四题找"链表中倒数第k个节点"所用的思想是一样的。**基本思路就是:** 定义两个节点 node1、node2;node1 节点先跑,node1节点 跑到第 n+1 个节点的时候,node2 节点开始跑.当node1 节点跑到最后一个节点时,node2 节点所在的位置就是第 (L-n ) 个节点(L代表总链表长度,也就是倒数第 n+1 个节点)
330330

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /