The linked list is a linear data structure for storing data. A lot of interview questions are asked on the linked list. In this post, I will show you how to count the number of nodes in the linked list. public class Linked…
In this post I will show you how to detect loop in linked list. We can find the loop in the linked list via Floyd’s Cycle-Finding Algorithm, explained here . The algorithm is pretty straightforward: We start at the begi…