tree reconstruction

S

sophia

Dear all,

Is it possible to re create a binary tree from given preorder and post
order traversals ?
 
W

Walter Roberson

sophia said:
Is it possible to re create a binary tree from given preorder and post
order traversals ?

Yes.

Look for,
"An optimal parallel algorithm to reconstruct a binary tree from its
traversals" by Stephan Olariu, Michael Overstreet and Zhaofang Wen
 
B

Ben Pfaff

sophia said:
Is it possible to re create a binary tree from given preorder and post
order traversals ?

I believe that there is an exercise in Knuth vol. 1 on this topic
or one closely related. I imagine that it has an answer, too.
 
A

Antoninus Twink


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

sophia

Yes.

Look for,
"An optimal parallel algorithm to reconstruct a binary tree from its
traversals" by Stephan Olariu, Michael Overstreet and Zhaofang Wen

where to get free copy of the above
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,083
Messages
2,570,589
Members
47,211
Latest member
JaydenBail

Latest Threads

Top