0 0 votes If inorder traversing a tree results in E A C K F H D B G, the preorder traversal would return (a) FAEKCDBHG (b) FAEKCDHGB (c) EAFKHDCBG (d) FEAKDCHBG Data Structures + – 8676rau 3.1k views answer comment Share Follow Print See all 15 Comments 15 15 Comments reply Shaik Masthan commented Feb 24, 2019 reply Follow flag in this question i relate pre-order and post order https://gateoverflow.in/2504/gate1994-8 after reading it, you may answer to this question ( i know this question relating pre-order and in-order ). If you still didn't get it after reading the answer, then comment ! by the way, option B is the answer !! 0 0 replyShare abhishekmehta4u commented Feb 25, 2019 reply Follow flag @ shaik Why not option a is true . 0 0 replyShare Shaik Masthan commented Feb 25, 2019 reply Follow flag in the picture you took option b but not option a, right? 0 0 replyShare abhishekmehta4u commented Feb 25, 2019 reply Follow flag Yes, i.e why not option b ?? 0 0 replyShare Shaik Masthan commented Feb 25, 2019 reply Follow flag I also commented option b as answer ! 0 0 replyShare srestha commented Feb 25, 2019 reply Follow flag @Shaik Masthan why left and right both leaves are need t be grater than root in that GATE question? I know some question need intution, but my logic saying, if they havenot mentioned any order, then the tree can be anything and there can be more than one tree , from which we can get that post order traversal Isnot it? 0 0 replyShare Shaik Masthan commented Feb 25, 2019 reply Follow flag Mam, comment on original question.. It is not search tree ( i.e., left is less than root and right is grater than root ). It's just ternary tree 0 0 replyShare srestha commented Feb 25, 2019 reply Follow flag @Shaik Masthan I mean these two also can be valid tree Am I wrong? if these diagram correct, then I add these diagram in main question too 0 0 replyShare srestha commented Feb 25, 2019 reply Follow flag Actually , logic always works right, than intution 0 0 replyShare Shaik Masthan commented Feb 26, 2019 reply Follow flag those tree following post order but not preorder 0 0 replyShare Shaik Masthan commented Feb 26, 2019 reply Follow flag mam, Note that, they defined pre-order also ! 0 0 replyShare srestha commented Feb 26, 2019 reply Follow flag @Shaik Masthan it is not BST. So, Preorder shouldnot always increasing order 0 0 replyShare Shaik Masthan commented Feb 26, 2019 reply Follow flag they defined pre order is 1 to 12 in the order respectively. moreover if it is even bst, we can't guarantee preorder is increasing sequence 0 0 replyShare srestha commented Feb 26, 2019 reply Follow flag moreover if it is even bst, we can't guarantee preorder is increasing sequence yes, inorder sequence increasing order. I missed it. but they havenot mentioned the term "respectively" they defined pre order is 1 to 12 in the order respectively. 0 0 replyShare Shaik Masthan commented Feb 26, 2019 reply Follow flag even though they didn't mention the teem " respectively ", you can get it by the given statement lines. 0 0 replyShare Please log in or register to add a comment.