mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-07 15:45:40 +08:00
Update
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
> 找到有没有环已经很不容易了,还要让我找到环的入口?
|
||||
|
||||
# 题目地址
|
||||
https://leetcode-cn.com/problems/linked-list-cycle-ii/
|
||||
|
||||
> 找到有没有环已经很不容易了,还要让我找到环的入口?
|
||||
|
||||
# 第142题.环形链表II
|
||||
|
||||
@ -46,7 +47,7 @@ fast和slow各自再走一步, fast和slow就相遇了
|
||||
动画如下:
|
||||
|
||||
|
||||
<video src='../video/142.环形链表II1.mp4' controls='controls' width='640' height='320' autoplay='autoplay'> Your browser does not support the video tag.</video></div>
|
||||
<img src='../video/141.环形链表.gif' width=600> </img></div>
|
||||
|
||||
|
||||
## 如果有环,如何找到这个环的入口
|
||||
@ -90,7 +91,7 @@ fast指针走过的节点数:` x + y + n (y + z)`,n为fast指针在环内走
|
||||
|
||||
动画如下:
|
||||
|
||||
<video src='../video/142.环形链表II.mp4' controls='controls' width='640' height='320' autoplay='autoplay'> Your browser does not support the video tag.</video></div>
|
||||
<img src='../video/142.环形链表II(求入口).gif' width=600> </img></div>
|
||||
|
||||
|
||||
那么 n如果大于1是什么情况呢,就是fast指针在环形转n圈之后才遇到 slow指针。
|
||||
|
Reference in New Issue
Block a user