- GATE CS
- 2026–27 pattern practice
- Data Structures
- BST
- Medium
The keys are inserted in this order into an empty binary search tree. What is the postorder traversal?
Trees
Pick an option to check your answer.
Answer: C. Solution
The insertions build a perfectly balanced tree: root ; left child (children , ); right child (children , ).
Postorder = left subtree, right subtree, root:
- Left subtree of :
- Right subtree of :
- Root:
Result: .
Why not the others
- is the inorder traversal (always sorted for a BST).
- is the preorder traversal.
- lists all leaves first, which is not a standard traversal.