edited by
6,338 views
2 votes
2 votes

If $\text{Tree-1}$ and $\text{Tree-2}$ are the trees indicated below:

Which traversals of $\text{Tree-1}$ and $\text{Tree-2}$, respectively, will produce the same sequence?

  1. Preorder, postorder
  2. Postorder, inorder
  3. Postorder, preorder
  4. Inorder, preorder
edited by

4 Answers

6 votes
6 votes
There is some discrepancy in this question. Postorder of Tree 1 : GJIHEFDBCA . Inorder of Tree 2 : GJIHEFBDCA. So I guess anyone attempting the question would be given marks.
3 votes
3 votes

none of these 

0 votes
0 votes
No option is correct

          $Tree 1$                                                                                                        

$PreOrder:ABDEGHIJFC$                                              

$InOrder: BGEHIJDFAC$                                                 

$PostOrder: GJIHEFDBCA$     

 

 

 

        $Tree 2$

$PreOrder:GFEIJHCDBA$

$InOrder:   GJIHEFBDCA$

$PostOrder: JHIEBDACFG$

 clearly we can see no order of tree 1 matches with any order of tree 2
Answer:

Related questions

1 votes
1 votes
3 answers
1
Arjun asked Dec 7, 2018
13,901 views
_____ traversals are not sufficient to build a binary tree.Preorder and InorderPostorder and InorderPostorder and PreorderNone of these
5 votes
5 votes
2 answers
2
Arjun asked Apr 22, 2018
15,039 views
Given a binary-max heap. The elements are stored in an arrays as $25, 14, 16, 13, 10, 8, 12$. What is the content of the array after two delete operations?$14,13,8,12,10$...