SinglyLinkedList/slist2.py
def has_a_cycle(self):
        """
        find linked list has a cycle or not
        :return:
        """
        if self._first == None or self._first.next == None:
            return False
        ptr1 = self._first
        ptr2 = self._first.next
        while ptr1 != ptr2:
            if ptr2 == None or ptr2.next == None:
                return False
            ptr1 = ptr1.next
            ptr2 = ptr2.next.next
        return True

        find linked list has a cycle or not
        :return:
        
find linked list has a cycle or not
find linked list has a cycle or not
def has_a_cycle(self):
        if self._first == None or self._first.next == None:
            return False
        ptr1 = self._first
        ptr2 = self._first.next
        while ptr1 != ptr2:
            if ptr2 == None or ptr2.next == None:
                return False
            ptr1 = ptr1.next
            ptr2 = ptr2.next.next
        return True
def has_a_cycle ( self ) : if self . _first == None or self . _first . next == None : return False ptr1 = self . _first ptr2 = self . _first . next while ptr1 != ptr2 : if ptr2 == None or ptr2 . next == None : return False ptr1 = ptr1 . next ptr2 = ptr2 . next . next return True
find linked list has a cycle or not
find linked list has a cycle or not
"""
        find linked list has a cycle or not
        :return:
        """
None
self