Cycle Detection using Floyd's Tortoise and Hare
algo
Finding cycles in graphs is an important problem in computer science. I’m ripping straight from wikipedia, but you can use it to check for infinite loops (e.g. function calls accidentally loop, which is a cycle in the call graph) or checking cryptographic hash functions (since they should be close to random functions, we can calculate statistics of random functions, and if the hash function we are testing is too far off, we have problems)1.
Read more...