by Antoninus Twink <nospam@[EMAIL PROTECTED]
>
May 9, 2008 at 10:00 PM
On 9 May 2008 at 19:53, Walter Roberson wrote:
> sophia <sophia.agnes@[EMAIL PROTECTED]
> wrote:
>
>>Is it possible to re create a binary tree from given preorder and post
>>order traversals ?
>
> Yes.
Well...
There's an ambiguity as soon as you have a node with no left descendant
or no right descendant. For example,
a and a
/ \
b b
both have preorder ab and postorder ba.
Of course, these trees are really the same, for some interpretation of
"really the same".