30 30 votes Which one of the following binary trees has its inorder and preorder traversals as $BCAD$ and $ABCD$, respectively? Data Structures gateit-2004 binary-tree easy data-structures + – Ishrat Jahan 8.0k views answer comment Share Follow Print See 1 comment 1 1 comment reply smsubham commented Nov 13, 2020 reply Follow flag In Preorder 1st element is root and everything to left of it in inorder is in LST and right is in RST. So A is root with BC in LST and D in RST. Option A,C eliminated. From BC, in preorder B is first so it should be the root. B is elminnated. So answer is D. Also as C is after it in inorder it should be in RST(with B as root). So D would be correct. 1 1 replyShare Please log in or register to add a comment.
Best answer 31 31 votes Answer is D. Inorder traversal is left node right. Preorder is node left right. Sankaranarayanan P.N answered Nov 14, 2014 • edited Jun 13, 2018 by Milicevic3306 Sankaranarayanan P.N comment Share Follow See all 4 Comments 4 4 Comments reply Arjun commented Nov 14, 2014 reply Follow flag D is correct rt? 1 1 replyShare Sankaranarayanan P.N commented Nov 14, 2014 reply Follow flag ya D is correct. mistake edited in the answer :) 0 0 replyShare Puja Mishra commented Dec 24, 2017 reply Follow flag Try it .. 0 0 replyShare Kiyoshi commented Apr 26, 2021 reply Follow flag @Puja Mishra I have seen this figure on 3 questions. In how many questions same figure. 2 2 replyShare Please log in or register to add a comment.
4 4 votes Inorder traversal 1) Traverse the left subtree 2) Visit the root 3) Traverse the right subtree Preorder traversal 1) Visit the root 2) Traverse the left subtree 3) Traverse the right subtree Bhagirathi answered Nov 20, 2014 Bhagirathi comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes ans is d in order left-root-right preorder root-left right after applying above formula we get exactly what they asking so d is correct Abhimanyu Kumar answered Nov 20, 2014 Abhimanyu Kumar comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes By this way we can create tree and Check options so option D is answer Rishi yadav answered Oct 5, 2017 Rishi yadav comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Option D is correct Pre = ABCD In = BCAD Post = CBDA Karan Suthar answered Sep 23, 2025 Karan Suthar comment Share Follow 0 reply Please log in or register to add a comment.