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:
       /    \
      /      \
     B       C
    / \      /
   /   \    /
  D   E  F


Popular posts from this blog