...
Question 8395 – Data-Structures
April 17, 2024
Question 8048 – Data-Structures
April 17, 2024
Question 8395 – Data-Structures
April 17, 2024
Question 8048 – Data-Structures
April 17, 2024

Question 7998 – Data-Structures

The pre-order traversal of a binary search tree is given by 12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20. Then the post-order traversal of this tree is:

Correct Answer: B

Question 18 Explanation: 

From these 2 orders, we can say 12 is the root & 8 is the root of left subtree & 16 is the root of right subtree.

From 2, 6, 7 we can identify 6 is the root from preorder traversal and from 9, 10 → 9 is root.
From <17, 19, 20>, 19 as root.

Hence, 2,7,6,10,9,8 |,15,17,20,19,16 |12 is the post-order traversal.
A
2, 6, 7, 8, 9, 10, 12, 15, 16, 17, 19, 20
B
2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12
C
7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 12
D
7, 6, 2, 10, 9, 8, 15, 16, 17, 20, 19, 12
0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
error: Alert: Content selection is disabled!!