7,085 views

3 Answers

Best answer
13 votes
13 votes

PostOrder Traversal of the given tree gives the output: 4 5 2 6 7 3 1.

Comparing the output with a b - c d * + , and making one-to-one correspondence with 4 5 2 6 7 3 1 , we get



1 $\rightarrow$ +,

2 $\rightarrow$ - ,

3 $\rightarrow$ *,

4 $\rightarrow$ a,

5 $\rightarrow$ b,

6 $\rightarrow$ c,

7 $\rightarrow$ d,
 

which matches with option (A)

edited by
0 votes
0 votes
In order will be (a-b)+(c*d)

now draw a traversal tree
1 flag:
✌ Edit necessary (MohitKashyap “It's not a BST you can't predict its Inorder”)
0 votes
0 votes

First we draw a curve around the tree starting at the root, moving along the edges and terminate at the root.

Now for the post order traversing, we list the vertices last time the curve passes.

Here those vertices are in order 4>>5>>2>>6>>7>>3>>1...

Since 4=a, 5=b, 2=-, 6=c, 7=d, 3=*, 1=+

This gives A as the answer...

edited by
Answer:

Related questions

2 votes
2 votes
2 answers
1
GO Classes asked Feb 4
274 views
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree?Inorder + PreorderPreorder + PostorderOnly InorderInorde...
2 votes
2 votes
1 answer
2