Take two pointers P1 and P2.
Initially let P1 and P2 point to starting node (S) and set counter to zero.
increment the counter
then check
while(1) {
if p1 == p2 ->next
{
print the counter value this is the node where circle starts.
exit();
}
else {
increment the counter;
p1 = p2;
p2 = p2->next;
if ( S == p2 )
exit(); if Staring node is equal to P2 then we have reached end of list.
}
}

1 User has rated as useful.
Login to rate this answer.
There are many ways to find loops in linked list but the best one is known as tortoise and hare algorithm.
In this we take 2 nodes say slow and fast node. Then we move the slow node by one shift ie startNode.next and the fast node with 2 shifts and then compare both slow and fast node. If they come to be equal at any time while iteration then this indicates that the linked list has a loop.
Login to rate this answer.