Gee, I think I could do that in one memory
location---cache the value
of the first pointer. Keep following the list, checking each address
against the cached value. If you hit 0, it terminates, otherwise if
the address matches the cached value, you have a loop.
That works only if the place you start from is part of the loop. If
there is a non-loopy part which runs into a loop, your algorithm will
compute forever when started in the non-loopy part.
Consider A->B->C->D->E->C, started at A.
Hmm ... good point.
-spc (But who constructs circular lists like that? 8-P