The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?
A
15, 10, 23, 25, 20, 35, 42, 39, 30
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
10, 20, 15, 23, 25, 35, 42, 39, 30
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
15, 10, 25, 23, 20, 42, 35, 39, 30
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
15, 20, 10, 23, 25, 42, 35, 39, 30
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is A 15, 10, 23, 25, 20, 35, 42, 39, 30
Binary search tree and preorder is given as 30, 20, 10, 15, 25, 23, 39, 35, 42
Postorder traversal of resultant tree is
15, 10, 23, 25, 20, 35, 42, 39, 30