Which one of the following binary trees has its inorder and preorder…
2004
Which one of the following binary trees has its inorder and preorder traversals as BCAD and ABCD, respectively?

- A.
A
- B.
B
- C.
C
- D.
D
Attempted by 181 students.
Show answer & explanation
Correct answer: D
To determine the correct binary tree, we reconstruct it from the given inorder and preorder traversals.
Step 1: In preorder traversal, the root is visited first. The preorder is ABCD, so A is the root.
Step 2: In inorder traversal, the left subtree is visited, then the root, then the right subtree. The inorder is BCAD, so B and C are in the left subtree of A, and D is in the right subtree.
Step 3: The left subtree of A has nodes B and C. In preorder, B comes before C, so B is the root of the left subtree.
Step 4: In inorder, B comes before C, so C is the right child of B.
Step 5: The right subtree of A has only D, so D is the right child of A.
The resulting tree structure matches option (a).
A video solution is available for this question — log in and enroll to watch it.