edited by
25,385 views
6 6 votes

The post-order traversal of binary tree is $\text{ACEDBHIGF}$. The pre-order traversal is

  1. $\text{A B C D E F G H I}$
  2. $\text{F B A D C E G I H}$
  3. $\text{F A B C D E G H I}$
  4. $\text{A B D C E F G I H}$

8 Answers

11 11 votes
You cannot create a unique tree with post and pre-order traversal you need to have either inorder with preorder or postorder this question seems ambiguous , if it would have been Binary search tree then inorder is sorted sequence and tree is possible but here only binary tree is given.
3 3 votes

The option which might be correct are b,c

Explanation:


 

 

 

 

 

 

 

 

 

 

 

 

 

We can definitely say that the root is F. A can never be the root. While out of option B and C one can't say correctly which would be a preorder for the given postorder. In order to find the preorder, we have to find all the possible trees.

So B or C or None of the options would be correct

edited by
0 0 votes
it may be answer c-because here in post-order(left right root) leftmost element is A and at last root element is given as F and as per preorder (root left right) so first element must be F and then C(because it is leftmost element in post-order).
0 0 votes
You cannot find pre-order traversal using post-order traversal only. I think you wrote a wrong question. It must be binary search tree then only we can find the post order traversal.
Answer:
Position:
Show:

Related questions

9 9 votes
3 answers 3 answers
9.3k
9.3k views
sh!va asked May 7, 2017
9,309 views
 If the post order traversal gives ab -cd * + then the label of the nodes 1,2,3.. will be+ , -, *, a,b,c,da, -,b,+,c,*,da,b,c,d,-,*,+-,a,b,+,*,c,d
2 2 votes
3 3 answers
221
221 views
Shubham Sharma 2 asked Apr 19
221 views
The inorder and preorder traversal of binary tree are $\mathrm{d}, \mathrm{b}, \mathrm{e}, \mathrm{a}, \mathrm{f}, \mathrm{c}, \mathrm{g}$ and $\mathrm{a}, \mathrm{b}, \m...
1 1 vote
2 2 answers
942
942 views
admin asked Oct 23, 2022
942 views
Consider the traversal of a treePreorder $\rightarrow$ $\text{ABCEIFJDGHKL}$Inorder $\rightarrow$ $\text{EICFJBGDKHLA}$Which of the following is correct post order traver...
6 6 votes
1 1 answer
195
195 views
GO Classes asked Jul 13
195 views
A binary tree has:Left subtree containing $1000$ nodes Right subtree containing $100$ nodesHow many nodes are processed before the root in preorder, inorder, and postorde...