Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. Consider the label sequences obtained by the following pairs of traversals on a labelled binary tree. Which of these pairs identify a tree uniquely ?
    (i) Preorder and postorder
    (ii) Inorder and postorder
    (iii) Preorder and inorder
    (iv) Level order and postorder
    1. (i) only
    2. (ii) and (iii)
    3. (iii) only
    4. (iv) only
Correct Option: B

For a tree we not only require in order & preorder but also postorder traversal.
Preorder & postorder help to determine the roots of binary subtrees, inorder arranges those roots in order. Hence (b) is correct option.



Your comments will be displayed only after manual approval.