Java program to detect a cycle in a singly LinkedList
Java program to detect a cycle in a singly LinkedList
In this article, we will learn how to detect a cycle or loop in a Linkedlist. We will be using Floyd’s cycle finding algorithm also know an the “tortoise and the hare algorithm”  Floyd’s Tortoise and Hare algorithm Floyd’s cycle-finding algorithm is a pointer algorithm that uses two pointers, which move through the sequence at different speeds. If the two pointers refer to the same node at some…
View On WordPress











