Gate2018 cs Q29

0. The postorder traversal of a binary tree is 8, 9, 6, 7, 4, 5, 2, 3,1. The inorder traversal of the same tree is 8, 6, 9, 4, 7, 2, 5, 1, 3. The height of a tree is the length of longest path from the root to any leaf. The height of the binary tree above is __________.

Note – Numerical Type question

  • Option : C
  • Explanation :
    Gate2018
    Given, post-order – 8, 9, 6, 7, 4, 5, 2, 3, 1 and in-order – 8, 6, 9, 4, 7, 2, 5, 1, 3
    So the height of tree is 4.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *