Which traversal of a Binary Search Tree (BST) gives values in ascending order?…
2021
Which traversal of a Binary Search Tree (BST) gives values in ascending order?
Preorder traversal
Postorder traversal
Inorder traversal
- A.
Only II
- B.
I and III
- C.
Only III
- D.
II and III
Attempted by 866 students.
Show answer & explanation
Correct answer: C
Correct answer: Only III
In a BST, left-subtree values are smaller than the root and right-subtree values are larger than the root.
Preorder: Root → Left → Right, so it does not guarantee ascending order.
Postorder: Left → Right → Root, so it also does not guarantee ascending order.
Inorder: Left → Root → Right, which gives ascending order for a BST.
Therefore, only statement III is correct.