Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 414 Bytes

判断链表中是否存在环.md

File metadata and controls

25 lines (13 loc) · 414 Bytes

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?

给定一个链表,判断其中是否存在环。

额外要求: 尽量不要使用额外空间

解题思路

使用快慢指针即可。

代码

这里