Cycle Detection Algorithm

The applications of cycle detection include testing the quality of pseudorandom number generators and cryptographic hash functions, computational number theory algorithms, detection of infinite loops in computer programs and periodic configurations in cellular automaton, and the automated shape analysis of associated list data structures. In computer science, cycle detection or cycle finding is the algorithmic problem of finding a cycle in a sequence of iterated function values.

Cycle Detection source code, pseudocode and analysis