Linked List Cycle
目录
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
两个node,速度不同,循环
slow 为 慢
fast为快
1 | /** |
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
两个node,速度不同,循环
slow 为 慢
fast为快
1 | /** |