There are several ways to find out if a loop is present in the linked list or not. Let’s look at the two ways: 1) If we can modify the linked list structure, then insert a Boolen (bool) flag called visited in the structure. Start traversing the linked list, on every node mark the flag visit […]
Finding a circular loop in a linked list
August 29th, 2009 | by Amit Sahrawat | published in Amit Sahrawat, Data Structures