【leetcode】141. Linked List Cycle 解题报告

判断链表中是否含有环。 方法一 最好的也是大家都知道的方法,用快慢指针法,如果慢指针能遇到快指针说明链表中有环 class Solution(object): def hasCycle(self, head): """ :type head: ListNode :rtype: bool """ if head == None: ret
相关文章
相关标签/搜索