Multiple choice

Consider the label sequences obtained by the following pairs of traversals on a labeled binary tree. Which of these pairs identify a tree uniquely?

  1. preorder and postorder
  2. inorder and postorder
  3. preorder and inorder
  4. level order and postorder

  1. 1 only

  2. 2 and 3

  3. 3 only

  4. 4 only

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

For a tree we not only require in order & preorder but also post order traversal. Preorder & post order help to determine the roots of binary subtrees, inorder arranges those roots in order.