Create tree from inorder and postorder traversal

Given inorder and postorder traversals construct a binary tree.
Let us consider the below traversals
Inorder sequence: D B E A F C
Postorder sequence: D E B F C A
tree should be:
A
       /    \
      /      \
     B       C
    / \      /
   /   \    /
  D   E  F

Comments

Popular posts from this blog