Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: tree recons...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 26136 of 26821
Post > Topic >>

Re: tree reconstruction

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".
 




 6 Posts in Topic:
tree reconstruction
sophia <sophia.agnes@[  2008-05-09 12:30:58 
Re: tree reconstruction
roberson@[EMAIL PROTECTED  2008-05-09 19:53:33 
Re: tree reconstruction
Ben Pfaff <blp@[EMAIL   2008-05-09 12:58:28 
Re: tree reconstruction
Antoninus Twink <nospa  2008-05-09 22:00:59 
Re: tree reconstruction
sophia <sophia.agnes@[  2008-05-10 01:40:10 
Re: tree reconstruction
roberson@[EMAIL PROTECTED  2008-05-10 12:29:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 1:17:59 CDT 2008.