The preorder traversal sequence of a binary search tree is 25, 15, 10, 4, 12, 22, 18, 24, 50, 35, 31, 44, 70, 66, 90 Which one of the following is the postorder traversal sequence of the same tree?

The preorder traversal sequence of a binary search tree is 25, 15, 10, 4, 12, 22, 18, 24, 50, 35, 31, 44, 70, 66, 90 Which one of the following is the postorder traversal sequence of the same tree? Correct Answer 4, 12, 10, 18, 24, 22, 15, 31, 44, 35, 66, 90, 70, 50, 25

The correct answer is option 2.

Concept:

In order to build a binary tree from given traversal sequences, one of the traversal sequences must be Inorder. The other traversal sequence might be either Preorder or Postorder. We know that the Inorder traversal of a Binary Search Tree is always in ascending order.

Preorder traversal sequence of a binary search tree,

25, 15, 10, 4, 12, 22, 18, 24, 50, 35, 31, 44, 70, 66, 90

Inorder traversal sequence of a binary search tree,

4, 10, 12, 15, 18, 22, 24, 25, 31, 35, 44, 50, 66, 70, 90

Additional Information

Tree traversal

 

Method flow

Inorder preorder postorder

Converse Inorder

Converse Preorder Converse  Postorder
  1. Left
  2. Root
  3. Right
  1. Root
  2. Left
  3. Right
  1. Left
  2. Right
  3. Root 
  1. Right
  2. Root
  3. Left
  1. Root
  2. Right
  3. Left
  1. Right
  2. Left
  3. Root

Related Questions

The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42. Which one of the following is the postorder traversal sequence of the same tree?
Postorder traversal of a given binary search tree T produces following sequence of keys: 3, 5, 7, 9, 4, 17, 16, 20, 18, 15, 14 Which one of the following sequences of keys can be the result of an in-order traversal of the tree T?
Consider the following data and specify which one is Preorder Traversal Sequence, Inorder and Postorder sequences. S1: N, M, P, O, Q S2: N, P, Q, O, M S3: M, N, O, P, Q
The pre-order traversal of a binary search tree is 15, 10, 12, 11, 20, 18, 16, 19. Which one of the following is the post order traversal of the tree?
In preorder traversal of a binary tree the second step is ____________