In tortoise and hare algorithm why do we always make hare go two steps forward and hare 1 step forward and then compare them, we can also make the hare go 1 step forward and then check if its equal again then increment both the tortoise and hare again check them if they are equal! I think this will help in finding the loop faster?
For eg. this pseudocode
tortoise := firstNode
hare := firstNode
forever:
if hare == end
return 'No Loop Found'
hare := hare.next
if hare == end
return 'No Loop Found'
if hare==tortoise
return true
hare = hare.next
tortoise = tortoise.next
if hare == tortoise
return 'Loop Found'