Re: infixorder -- more hints for Oriana, and a slightly OT but interesting consideration

2007-02-04 Thread Jon Wilson
Hi Luca, Ok, I think I've helped you. Now in return I'd like you to listen, while I tell you a little story. --snip all content-- Best wishes for your life, Hear hear! I love a good impassioned speech, and particularly when it is advocating the Right Thing. You aren't by any chance

Re: infixorder -- more hints for Oriana, and a slightly OT but interesting consideration

2007-01-31 Thread Luca Saiu
Hi Oriana. I see a problem in your statement. You don't say how a binary tree is encoded as an S-expression. From your example I'd initially deduce (let's call this encoding (i)) that you represent a leaf tree as a one-element list: (node) and a non-leaf tree as a three element list: (left

Re: infixorder

2007-01-30 Thread Jon Wilson
Hi Oriana, Well, since you're learning scheme, here is a tip: Use the conventional indentation and such. It will seem weird and you will find yourself counting parens at first, but quickly you will get used to it, and begin to not even see the parens. Your code snippet should be written: (e

Re: infixorder

2007-01-30 Thread Ian Grant
On Tue, 30 Jan 2007 15:43:31 +0100 "Mikael Djurfeldt" <[EMAIL PROTECTED]> wrote: > This type of question usually turns up when a student wants help with > homework and is therefore usually dismissed---in any case you wouldn't > learn anything if you got the complete code. As witnessed by the fact

Re: infixorder

2007-01-30 Thread Mikael Djurfeldt
2007/1/30, oriana paro <[EMAIL PROTECTED]>: Hi. I'm learning scheme (Guile) and I have some problem with the infix order walk in a tree... I want to write a function infixwalk that walks though a tree in infix order (left tree - node - righ tree) so that the call (equal? (infixwalk '(

infixorder

2007-01-30 Thread oriana paro
Hi. I'm learning scheme (Guile) and I have some problem with the infix order walk in a tree... I want to write a function infixwalk that walks though a tree in infix order (left tree - node - righ tree) so that the call (equal? (infixwalk '( (a) b ( (c) d (e) ) ) ) '(b a d c e)