Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!newsfeed.internetmci.com!news.dacom.co.kr!usenet.seri.re.kr!news.imnet.ad.jp!wnoc-tyo-news!dclsic!yilnws!wnoc-sfc-news!kogwy!math-keio!mad
From: mad@math.keio.ac.jp (MAEDA Atusi)
Subject: Re: Cycle-detection algorithm?
In-Reply-To: cdjeris@midway.uchicago.edu's message of Mon, 19 Feb 1996 03:37:09 GMT
Message-ID: <MAD.96Feb20151407@tanzanite.math.keio.ac.jp>
Sender: news@math.keio.ac.jp
Nntp-Posting-Host: tanzanite
Reply-To: mad@math.keio.ac.jp
Organization: Faculty of Sci. and Tech., Keio Univ., Yokohama, Japan.
References: <Dn07Dx.C6q@midway.uchicago.edu>
Date: Tue, 20 Feb 1996 06:14:07 GMT
Lines: 22

>>>>> "cdjeris" == Christopher Jeris <cdjeris@midway.uchicago.edu> writes:
In article <Dn07Dx.C6q@midway.uchicago.edu> cdjeris@midway.uchicago.edu (Christopher Jeris) writes:

    cdjeris> I'm working through SICP in my spare time to learn some things about
    cdjeris> programming, and came across the following exercise:

    cdjeris> 3.19 Write a procedure that determines, _in_constant_space_, whether a
    cdjeris> given list structure contains a cycle.
    [...deleted...]
    cdjeris> Maybe this is more an algorithms question than a Scheme question (it's
    cdjeris> not a homework question!) so could anyone point me to a reference for
    cdjeris> an algorithm which does the trick in constant space?  I'm a math
    cdjeris> student only recently interested in CS, and I don't know much about
    cdjeris> algorithms -- the one reference I checked (Sedgewick's "Algorithms in
    cdjeris> Modula-3") wasn't any help.

See the description of list-length function (section 15.2) in "Common
Lisp the Language: 2nd edition" (Steele, et al., Digital Press; also
available as http://www.cs.cmu.edu/Web/Groups/AI/html/cltl/cltl2.html
or ftp://cambridge.apple.com/pub/CLTL/)

				--mad
