1 1 vote A rooted tree with 8 nodes has its nodes [1.....8] in preorder.When the tree is traversed in postorder.....nodes visited are {3,5,4,2,7,8,6,1}. Draw a tree for it. How to solve .....someone please explain? Data Structures binary-tree data-structures + – Shivi rao 1.5k views answer comment Share Follow Print See all 8 Comments 8 8 Comments reply pawan kumarln commented Nov 1, 2017 reply Follow flag 10 or 1??? 0 0 replyShare joshi_nitish commented Nov 1, 2017 reply Follow flag unique binary tree can not be created if preorder and postorder are given.. 1 1 replyShare Shivi rao commented Nov 1, 2017 reply Follow flag yes that I know but please have a look at this https://gateoverflow.in/2504/gate1994_8 0 0 replyShare joshi_nitish commented Nov 1, 2017 reply Follow flag i dont know how they have created that tree, because there is no algorithm to create unique tree from given post and pre order only 0 0 replyShare A_i_$_h commented Nov 1, 2017 reply Follow flag its not possible to construct a tree given preorder and postorder question seems ambiguos but that link ...shows an answer where the tree is constructed..no idea of its logic though @arjun sir please confirm 0 0 replyShare Hemant Parihar commented Nov 1, 2017 reply Follow flag We can construct the unique binary tree using preorder and postorder if we assume (or it is given) that every internal node has two children. 1 1 replyShare Shivi rao commented Nov 1, 2017 reply Follow flag Please elaborate it 0 0 replyShare A_i_$_h commented Nov 8, 2017 reply Follow flag @hemant canu give an example of such a question with solution will be helpful :) 0 0 replyShare Please log in or register to add a comment.
0 0 votes pre-order = 12345678 post-order = 35427861 Badayayash answered Jan 23, 2019 Badayayash comment Share Follow 0 reply Please log in or register to add a comment.