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) 10, 20, 15, 23, 25, 35, 42, 39, 30
(B) 15, 10, 25, 23, 20, 42, 35, 39, 30
(C) 15, 20, 10, 23, 25, 42, 35, 39, 30
(D) 15, 10, 23, 25, 20, 35, 42, 39, 30
Answer: (D)
Explanation: The following is the constructed tree
30
/ \
20 39
/ \ / \
10 25 35 42
\ /
15 23
Recommended Posts:
- Data Structures | Binary Search Trees | Question 3
- Data Structures | Binary Search Trees | Question 7
- Data Structures | Binary Search Trees | Question 2
- Data Structures | Binary Search Trees | Question 1
- Data Structures | Binary Search Trees | Question 4
- Data Structures | Binary Search Trees | Question 5
- Data Structures | Binary Search Trees | Question 6
- Data Structures | Binary Search Trees | Question 12
- Data Structures | Binary Search Trees | Question 10
- Data Structures | Binary Search Trees | Question 12
- Data Structures | Binary Search Trees | Question 12
- Data Structures | Balanced Binary Search Trees | Question 4
- Data Structures | Balanced Binary Search Trees | Question 11
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 10
- Data Structures | Balanced Binary Search Trees | Question 13
- Data Structures | Balanced Binary Search Trees | Question 12
- Data Structures | Balanced Binary Search Trees | Question 5
- Data Structures | Balanced Binary Search Trees | Question 7
- Data Structures | Balanced Binary Search Trees | Question 13

