Which traversal of binary search tree is in ascending order? I. Pre Order Traversal II. Post Order Traversal III. In Order Traversal
A Binary Search Tree (BST) is a tree data structure where for each node:
Tree traversals are methods for visiting all the nodes in a tree exactly once. The order in which nodes are visited determines the output sequence. Let's examine the common traversals mentioned:
Consider the properties of a BST. The left subtree contains smaller values, the node itself has a value between its left and right children (if they exist), and the right subtree contains larger values.
Let's analyze how each traversal interacts with this property:
Consider a BST with nodes 10, 5, 15, 3, 7, 12, 18.
| Traversal Type | Order Visited |
|---|---|
| Pre Order | 10, 5, 3, 7, 15, 12, 18 |
| In Order | 3, 5, 7, 10, 12, 15, 18 |
| Post Order | 3, 7, 5, 12, 18, 15, 10 |
As seen in the table, the In Order Traversal produces the nodes in ascending numerical order.
Based on the structure and traversal methods of a Binary Search Tree, only the In Order traversal guarantees visiting the nodes in ascending order.
| Traversal Name | Visit Order | Output for BST |
|---|---|---|
| Pre Order | Node, Left, Right | Not necessarily sorted |
| In Order | Left, Node, Right | Ascending order (Sorted) |
| Post Order | Left, Right, Node | Not necessarily sorted |
Besides traversal, common operations on a Binary Search Tree include:
The efficiency of BST operations largely depends on the tree's height. In the best case (a balanced tree), $h \approx \log n$ where $n$ is the number of nodes. In the worst case (a skewed tree), $h = n$.
Consider the traversal of a tree
Preorder → ABCEIFJDGHKL
Inorder → EICFJBGDKHLA
Which of the following is correct post order traversal?
Postorder traversal of a given binary search tree T produces following sequence of keys: 3, 5, 7, 9, 4, 17, 16, 20, 18, 15, 14 Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?
The inorder traversal of the following tree is :

Level order Traversal of a rooted Tree can be done by starting from root and performing :
The inorder and preorder Traversal of binary Tree are dbeafcg and abdecfg respectively. The post-order Traversal is __________.