title: How to determine whether a linked list contains a loop?
body: <blockquote>
    <p><strong>Possible Duplicates:</strong><br>
    <a href="https://stackoverflow.com/questions/2338683/find-whether-a-loop-in-a-linked-list-without-two-pointers">find whether a loop in a linked list without two pointers</a><br>
    <a href="https://stackoverflow.com/questions/494830/how-to-determine-if-a-linked-list-has-a-cycle-using-only-two-memory-locations">How to determine if a linked list has a cycle using only two memory locations.</a><br>
    <a href="https://stackoverflow.com/questions/34249/best-algorithm-to-test-if-a-linked-list-has-a-cycle">Best algorithm to test if a linked list has a cycle</a>  </p>
  </blockquote>
  
  
  
  <p>During a preparation for a job interview, I encountered the following question:</p>
  
  <p>How can you determine whether a linked list (of any type) contains a loop, using additional space complexity of O(1)? You cannot assume that the loop starts at the first node (and of course, the loop doesn't have to contain all nodes).</p>
  
  <p>I couldn't find the answer, though I have the feeling it's quite simple...</p>