1,185 views

4 Answers

1 votes
1 votes

To clarify your doubt i'hv taken exmaple.  Parimal Paritosh

0 votes
0 votes

Given any of below order traversal you will able to identify tree..

(Inorder and Preorder)  OR  (Inorder and Level-order)  OR (Inorder and Postorder)

0 votes
0 votes
There is always a unique tree which satisfies all the three conditions.
0 votes
0 votes

We know that given post-order and in-order or pre-order and in-order we can uniquely construct a binary tree.

 But it might be possible that given any arbitrary sequences, it is not necessary that there is a binary tree corresponding to that, just like in the example given by you. There exists no binary tree which will satisfy the given post-order and in-order simultaneously.

You may refer to this nptel lecture (at time 35:04)

https://www.youtube.com/watch?v=eWeqqVpgNPg&list=PLBF3763AF2E1C572F&index=7

Related questions

4 votes
4 votes
4 answers
1
Parshu gate asked Nov 27, 2017
6,669 views
How many different binary search trees can be constructed using six distinct keys? 256 128 132 264
0 votes
0 votes
1 answer
2