Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'instance,': 0.05; 'assumed': 0.09; 'stack.': 0.09; 'am,': 0.14; 'received:209.85.214.174': 0.14; 'received:mail- iw0-f174.google.com': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'pointers': 0.16; 'structure,': 0.16; 'stack': 0.16; 'tree': 0.19; 'header:In-Reply-To:1': 0.21; 'raymond': 0.22; 'thu,': 0.22; 'memory': 0.22; 'demonstrate': 0.26; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.214': 0.28; 'if,': 0.30; 'parent': 0.30; 'done': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'chris': 0.34; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'but': 0.38; 'data': 0.38; 'signal': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'chain': 0.66; 'sort.': 0.91; 'subject:English': 0.91; 'you...': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=TQhgne091OJhqkKwfarHyrxO42Ts0O18fjcs+VcQgk8=; b=HT85+5LS8Rfhh1LTPAhsrmG0Uj9AqZ0/J7Xn5z50kMUjWXi0C+uupT0k1E8az3420h bsH2cmzhPbHeT5UQUqF0mE/TKSRjScDIBUvlYFc6EyBPhvoMEnnmZqgAlD17Yr1hd2BD Stgr/7Qw5/2MU/lrVS236vPM2Z+3rjgqkiM2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=KWrPP8YMcAK60AtJQ1lerQA9DSGIhm6gAQN2PFfAx47xo8U6a269X7pKVHdiBfdT8c RJ/6SaYjUz1m5QdDHaXOLdrgwNCgL1Dn2OUhahPyZCOXr2A8LZwxZVkcF1a/bHGM5a4X Y4xEvi5sZRGVaijS/75beLtXUKhyOnnwsvoXA= MIME-Version: 1.0 In-Reply-To: References: <87aaekoab7.fsf@kuiper.lan.informatimago.com> Date: Thu, 19 May 2011 04:41:21 +1000 Subject: Re: English Idiom in Unix: Directory Recursively From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305744088 news.xs4all.nl 49180 [::ffff:82.94.164.166]:44880 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5725 On Thu, May 19, 2011 at 4:20 AM, Raymond Wiker wrote: >> You are right that I assumed parent pointers of some description; >> but it does demonstrate that tree walks can be done iteratively, >> without keeping a stack of any sort. > > =A0 =A0 =A0 =A0Except that the chain of parent pointers *would* constitue= a > stack. Howso? It's part of your data structure, not part of your algorithm; and it's not something that grows and shrinks as you traverse. These considerations may be crucial if, for instance, you want to walk your tree in a signal handler, and you don't know how much memory is available to you... Chris Angelico