LeetCode 141.
题目来源:https://leetcode.com/problems/linked-list-cycle
题目难度:Easy
1 | // 链表的结构 |
解法1[Java]:快慢指针
1 | public class Solution { |
解法2[Java]:Hash表
1 | public boolean hasCycle(ListNode head) { |
LeetCode 141.
题目来源:https://leetcode.com/problems/linked-list-cycle
题目难度:Easy
1 | // 链表的结构 |
1 | public class Solution { |
1 | public boolean hasCycle(ListNode head) { |