Construct Binary Tree From Inorder And Postorder

Given inorder and postorder traversal of a tree, construct the binary tree.

Note: You may assume that duplicates do not exist in the tree.

Example :

Input : 
        Inorder : [2, 1, 3]
        Postorder : [2, 3, 1]

Return : 
            1
           / \
          2   3

Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
2767 successful submissions.
Asked In:
  • Amazon
  • Microsoft
Click here to jump start your coding interview preparation