Subject: RE: Detecting Infinite Looping From: Gavin Nicol <gtn@xxxxxxxxxxxx> Date: Thu, 29 Jan 1998 10:37:12 GMT |
The standard algorithm for detecting loops in linked lists is the "tortoise and hare" algorithm, where you have 2 pointers moving along the list, one at twice the pace of the other. If the faster pointer ever passes the slower pointer, there is a loop. Also, some LISP systems had a way of persisting circular lists, so there must be code out there for this (been a long time since I used a symbolics...) DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Detecting Infinite Looping, Pawson, David | Thread | Re: Detecting Infinite Looping, W. Eliot Kimber |
Re: Detecting Infinite Looping, Henry Thompson | Date | Re: Detecting Infinite Looping, W. Eliot Kimber |
Month |