Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

Data Structures | Tree Traversals | Question 2

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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


Quiz of this Question

My Personal Notes arrow_drop_up
Last Updated : 28 Jun, 2021
Like Article
Save Article
Similar Reads
Related Tutorials