From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3a91e8aaa1d74db9,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsread.com!news-xfer.newsread.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.tiscali.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Thu, 12 May 2005 08:58:55 +0200 From: "VBTricks.de.vu Webmaster" User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Search trees Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4282fe37$0$7517$9b4e6d93@newsread2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 12 May 2005 08:56:55 MEST NNTP-Posting-Host: f5c430d1.newsread2.arcor-online.net X-Trace: DXC=k8ZYJWkN?HnCUhGd:LVK2eQ5U85hF6f;djW\KbG]kaMh:cmYYm_h3\cB:7X40m3A3m^OW<^BOf\Ag85WNFRYMn7m X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:11009 Date: 2005-05-12T08:56:55+02:00 List-Id: Hello, I'm currently working with search-trees, more exactly different methods of listings the items in the search-tree (postfix/postorder, infix/inorder, prefix/preorder). Doing this recursively is no problem, but for an exercise I now need to implement these functions iteratively (meaning not recursively). The only hint I got was to save which children trees I have not walked through. But after four days of thinking I still don't get it. That's my structure for the nodes of the tree: type node; type tree is access node; type node is record value : integer; left : tree; right : tree; end record; and here a sample for a recursive infix-walkthrough: procedure Infix(t: tree) is begin if t /= null then Infix(t.left); Put(t.value); Infix(t.right); end if; end; What is the clue? How do I implement it iteratively? Please help me! Thanks in advance, Stefan