edited by
10,726 views
7 7 votes

The in-order traversal of a tree resulted in FBGADCE. Then the pre-order traversal of that tree would result in

  1. FGBDECA
  2. ABFGCDE
  3. BFGCDEA
  4. AFGBDEC

4 Answers

Best answer
11 11 votes
If we try to generate tree from question, we get following tree.

                        A

                  B             C

       F               G      D       E

 

Its inorder = FBGADCE

and preorder = ABFGCDE
selected by
2 2 votes
This Question is ambiguous to construct a tree we must have either $InOrder & PreOrder or  InOrder & PostOrder$

but for a binary search tree we can only have PreOrder or PostOrder as in order of BST is non-decreasing order of keys.
0 0 votes
inorder is given that means left root right means middle one is our root .  so here in given inorder middle one is A in  FBGADCE then break into 2 part on left  FBG and on right DCE then apply same thing on FBG here B is middle and other hand C is middle then now we have tree . from tree we easily get preorder
1 flag:
✌ Low quality (Sanjog karan “wrong approach”)
Answer:
Position:
Show:

Related questions

10 10 votes
3 answers 3 answers
23.7k
23.7k views
go_editor asked Jun 23, 2016
23,688 views
The average depth of a binary search tree is$O(n^{0.5})$$O(n)$$O(\log n)$$O(n \log n)$
10 10 votes
8 answers 8 answers
11.4k
11.4k views
shibu asked Jun 15, 2016
11,397 views
If node A has three siblings and B is parent of A, what is the degree of A?0345
13 13 votes
3 answers 3 answers
12.5k
12.5k views
ajit asked Oct 1, 2015
12,549 views
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$35$
6 6 votes
8 8 answers
25.4k
25.4k views
Satbir asked Jan 13, 2020
25,409 views
The post-order traversal of binary tree is $\text{ACEDBHIGF}$. The pre-order traversal is$\text{A B C D E F G H I}$$\text{F B A D C E G I H}$$\text{F A B C D E G H I}$$\t...