The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be ________

The post-order traversal of a binary tree is O P Q R S T. Then possible pre-order traversal will be ________ Correct Answer T Q O P S R

The last, second last nodes visited in post-order traversal are root and it’s right child respectively. Option T Q R S O P can’t be a pre-order traversal, because nodes O, P are visited after the nodes Q, R, S. Option T O Q R P S, can’t be valid, because the pre-order sequence given in option T O Q R P S and given post-order traversal creates a tree with node T as root and node O as left subtree. Option T Q O P S R is valid. Option T Q O S P R is not valid as node P is visited after visiting node S.
Bissoy MCQ

Related Questions

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
In preorder traversal of a binary tree the second step is ____________
Find the postorder traversal of the binary tree shown below.
A tree is cut partially and made to fall on ground. The tree however does not fall completely and is still attached to its cut part. The tree top touches the ground at a point 10m from foot of the tree making an angle of 30°. What is the length of the tree?