Related Articles

Related Articles

UGC-NET | UGC NET CS 2015 Jun – II | Question 22
  • Last Updated : 11 May, 2018

The inorder and preorder Traversal of binary Tree are dbeafcg and abdecfg respectively. The post-order Traversal is __________.
(A) dbefacg
(B) debfagc
(C) dbefcga
(D) debfgca


Answer: (D)

Explanation: Inorder and preorder Traversal of binary Tree are dbeafcg and abdecfg respectively.
From preorder(Parent left right) and inorder ( left parent right) we can easily find post order.
From preorder(a(bdecfg)), it is clear that a is parent node(root node), Now we will look for left subttree in inorder traversal i.e. dbe and fcg.
To find root node and left subtree and right subtree of these subtree we will do the same process as above:
Now see this scenario in graph:
22 (8)
Now from above tree we can easily find out the post order(left right parent):
i.e. debfgca.
So, option (D) is correct.

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :