Construct Tree Using Inorder and PostOrder
Given Postorder and Inorder traversal of a binary tree, create the binary tree associated with the traversals. You just need to construct the tree and return the root.
Note: Assume binary tree contains only unique elements.
Input format :
Line 1 : n (Total number of nodes in binary tree)
Line 2 : Post order traversal
Line 3 : Inorder Traversal
Output Format :
Elements are printed level wise, each level in new line (separated by space).
Comments
Post a Comment
Please give us your valuable feedback