title: Why increase pointer by two while finding loop in linked list, why not 3,4,5?
body: <p>I had a look at <a href="https://stackoverflow.com/questions/2663115/interview-question-how-to-detect-a-loop-in-a-linked-list">question</a> already which talk about algorithm to find loop in a linked list. I have read <a href="http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare" rel="noreferrer">Floyd's cycle-finding algorithm</a> solution, mentioned at lot of places that we have to take two pointers. One pointer( slower/tortoise ) is increased by one and other pointer( faster/hare ) is increased by 2. When they are equal we find the loop and if faster pointer reaches null there is no loop in the linked list.</p>
  
  <p>Now my question is why we increase faster pointer by 2. Why not something else? Increasing by 2 is necessary or we can increase it by X to get the result. Is it necessary that we will find a loop if we increment faster pointer by 2 or there can be the case where we need to increment by 3 or 5 or x.</p>