311 views

1 Answer

Best answer
2 votes
2 votes

For Postorder Root will be at rightend.

For Inorder Root will be at Middle.

Now look at the post order  where is a(root) last end. find  element a in inorder it is somewhere in middle.

Consider inorder , Pull that a in to top now left children will be elements left to a and right children will be elements right to a

Check for next element from right corner in postorder i.e.,d find where is d in inorder pull it to top and repeat the above steps.

Final resultant tree and its preorder.

selected by

Related questions

0 votes
0 votes
0 answers
1
Vikas123 asked Jan 8, 2019
700 views
Acc. to (question) my solution is...uniquely constructed binary tree PRE+POST and IN+POST…where i am wrong….
0 votes
0 votes
2 answers
2