/floyd-cycle-detection-algorithm

An Java implementation of LinkedList ADT and the Floyd's cycle-finding algorithm,

Primary LanguageJava

Floyd's cycle-finding algorithm

Floyd's cycle-finding algorithm, also called the "tortoise and the hare" algorithm, is a pointer algorithm that uses only two pointers, which move through the sequence at different speeds.

I implemented a subset of the linked list abstract data type, I could have use the java.util.LinkedList, but I prefer it to be not dependent from other classes.

I created test for both, the LinkedList and the algorithm.