You are viewing a single comment's thread. Return to all comments →
+1 on the 100 limit. Here's mine in Python:
def has_cycle(head): count = 0 while head.next: head = head.next count += 1 if count > 100: return True return False
Seems like cookies are disabled on this browser, please enable them to open this website
Linked Lists: Detect a Cycle
You are viewing a single comment's thread. Return to all comments →
+1 on the 100 limit. Here's mine in Python: