Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!scramble.lm.com!news.math.psu.edu!chi-news.cic.net!condor.acc.iit.edu!uchinews!not-for-mail
From: cdjeris@midway.uchicago.edu (Christopher Jeris)
Subject: Re: Cycle-detection algorithm?
X-Nntp-Posting-Host: quads.uchicago.edu
Message-ID: <Dn1BCI.8o9@midway.uchicago.edu>
Summary: Pointer chasing...
Sender: news@midway.uchicago.edu (News Administrator)
Organization: The University of Chicago
References: <Dn07Dx.C6q@midway.uchicago.edu> <tonyk-1902960043360001@dial1-11.cybercom.net>
Date: Mon, 19 Feb 1996 18:00:18 GMT
Lines: 10

Thanks to all who responded, for putting up with my silly elementary
questions.  The consensus answer was to use two pointers, one moving faster
than the other, and see when they collide.  This works easily for lists
which are known to be linear or cyclic.  For general list structures the
answer is not quite so clear, but I think "two pointers" was the idea I
needed.  Thank you!

Christopher Jeris		University of Chicago Math:
 c-jeris@uchicago.edu		 The mother of all functors awaits you.

