Question 54

What is common in three different types of traversals (inorder, preorder and postorder)?

  1. ARoot is visited before right subtree
  2. BLeft subtree is always visited before right subtree
  3. CRoot is visited after left subtree
  4. DAll of the above
Show answerHide answer

Correct answer: (B) Left subtree is always visited before right subtree

Explanation

In inorder, preorder and postorder the left subtree is always visited before the right subtree. Only the position of the root changes.

From DSSSB TGT Computer Science Practice Set 5

This is question 54 of DSSSB TGT Computer Science Practice Set 5. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.