Data Structures | Tree Traversals | Question 2
What is common in three different types of traversals (Inorder, Preorder and Postorder)?
(A) Root is visited before right subtree
(B) Left subtree is always visited before right subtree
(C) Root is visited after left subtree
(D) All of the above
(E) None of the above
Answer: (B)
Explanation: The order of inorder traversal is
LEFT ROOT RIGHT
The order of preorder traversal is
ROOT LEFT RIGHT
The order of postorder traversal is
LEFT RIGHT ROOT
In all three traversals, LEFT is traversed before RIGHT
Recommended Posts:
- Data Structures | Tree Traversals | Question 12
- Data Structures | Tree Traversals | Question 1
- Data Structures | Tree Traversals | Question 3
- Data Structures | Tree Traversals | Question 10
- Data Structures | Tree Traversals | Question 4
- Data Structures | Tree Traversals | Question 9
- Data Structures | Tree Traversals | Question 7
- Data Structures | Tree Traversals | Question 5
- Data Structures | Tree Traversals | Question 8
- Data Structures | Tree Traversals | Question 11
- Data Structures | Tree Traversals | Question 6
- Introduction to Data Structures | 10 most commonly used Data Structures
- Data Structures | Stack | Question 5
- Data Structures | Queue | Question 8
- Data Structures | Graph | Question 3



