Take 2 pointers.. p1 and p2...
make p1 traverse the list at the rate of one node / cycle
and p2 traverse the list at the rate of 2 nodes / cycle.
If p1 and p2 match then there is a loop , otherwise not.. make sure you check for NULL (termination condition)
say head of the list is root.
bool loop = FALSE;
p1 = p2 = root;
while ( p1 && p2->next)
{
p1 = p1->next;
p2 = p2->next->next;
if (p1 == p2)
{
loop = TRUE;
break;
}
}