Arrange the following steps of the Inorder Traversal of Binary Tree in the correct order.
A. Visit the Left subtree
B. Visit the Root node
C. Visit the Right subtree
D. Start traversing by visiting the nodes in rooted tree
E. Repeat the above three steps.
Choose the correct answer from the options given below:
1.A, B, C, D, E
2.E, A, B, C, D
3.D, A, B, C, E ✓ Correct
4.D, A, E, B, C
Solution
The correct answer is option 3: D, A, B, C, E
Key Points
Inorder traversal of a binary tree is a type of depth-first traversal where nodes are visited in the following order:
- Step 1: Start traversing by visiting the nodes in the rooted tree.
- Step 2: Visit the Left subtree.
- Step 3: Visit the Root node.
- Step 4: Visit the Right subtree.
- Step 5: Repeat the above three steps for each subtree.