Re: iterative copying of binary expression trees
- From: Jean Guillaume Pyraksos <wissme@xxxxxxxxxxx>
- Date: Sun, 24 May 2009 12:07:25 +0200
It is iterative and functional, I pass the stack as an argument.
push and pop are *not* destructive. See the last reply from pjb...
Thanks Pascal, I'll get an eye on your lap-level solution :-)
JG
In article
<a868c224-0358-42ee-a58f-0349999d702d@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
gugamilare <gugamilare@xxxxxxxxx> wrote:
On 23 maio, 12:01, Jean Guillaume Pyraksos <wis...@xxxxxxxxxxx> wrote:.
None, I do *want* a tail-recursive, purely functional, first order solution.
I'll try myself, or prove me that this is impossible.
I have already such a tail-recursive, purely functional, first order solution
in O(n) but two-phase, in 2n iterative steps.
I'm looking for a one-phase solution. I don't see on the theoretical side why
I couldn't find one.
But are you sure that the first phase of your algorithm is iterative
and purely functional? You said you push the left son into a stack,
and this is not exactly functional (you need to use "pop", which is
destructive). You can do the exact same thing to create your algorithm.
- Follow-Ups:
- Re: iterative copying of binary expression trees
- From: Kaz Kylheku
- Re: iterative copying of binary expression trees
- References:
- iterative copying of binary expression trees
- From: Jean Guillaume Pyraksos
- Re: iterative copying of binary expression trees
- From: Pascal J. Bourguignon
- Re: iterative copying of binary expression trees
- From: Jean Guillaume Pyraksos
- Re: iterative copying of binary expression trees
- From: Pascal J. Bourguignon
- Re: iterative copying of binary expression trees
- From: Jean Guillaume Pyraksos
- Re: iterative copying of binary expression trees
- From: gugamilare
- iterative copying of binary expression trees
- Prev by Date: Re: Is Apress' book good?
- Next by Date: Re: Is Apress' book good?
- Previous by thread: Re: iterative copying of binary expression trees
- Next by thread: Re: iterative copying of binary expression trees
- Index(es):
Relevant Pages
|
Loading