[plt-scheme] Re: Help: I want to travel a binary tree?

From: Zeng Fucen (zengfucen at gmail.com)
Date: Tue Jul 31 11:16:28 EDT 2007

I'm wrong!!!

That's a binary tree,,,should be defined like this:((4 2 5) 1 (6 3 7))

                1
                |
      ---------------------
      2                   3
      |                   |
------------         ------------
4         5          6         7

I want result of the traversal is : 1 2 3 4 5 6 7  ,,, how to?


On 7月31日, 下午10时56分, "Hans Oesterholt-Dijkema" <hdn... at gawab.com>
wrote:
> Why don't you define a tree like this
>
> (1 (2 (4 () ()) (5 () ())) (3 (6 () ()) (7 () ()))
>
> ?
>
> --Hans
>
> Op 31/7/2007 schreef "Zeng Fucen" <zengfu... at gmail.com>:
>
> >I'm a scheme novice,
>
> >I want to travel a binary tree, how to ? (depth first)
>
> >Thanks for your tips , first!
>
> >I define a tree like this:  (1 (2 4 5) (3 6 7))
>
> >_________________________________________________
> >  For list-related administrative tasks:
> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.