00:01
In this question here, yes, the tree can be constructed from inorder and postorder travel.
00:09
So, consider a tree with a duplicate so that you can understand every case.
00:15
So, here the duplicate tree is 1, 3, 15, 20, 7, 5, 9, 9 or here it is 3.
00:45
So, here inorder, inorder 9, 3, 1, 15, 3, 20 and 7 are left root right, left root right and postorder, postorder 9, 1 and postorder 9, 1, 3, 15, 7, 20, 3 is left right root, is left right root.
01:46
So, inorder given left root right, so here inorder given left root right, so here inorder a is element in left subtree is, so here element in left subtree is 9, element before inorder and d, element in right subtree is, element in right subtree is 1, 15, 3, 20, 7, element in order after root.
02:50
So, consider a and b as independent tree.
02:55
So, here for tree a, for tree a, here inorder in order is 9 and postorder is also 9.
03:21
Take same element in postorder as of inorder.
03:24
So, there is only one element, so it is only a leaf node.
03:28
So, here it is only a leaf node.
03:40
For zero element empty tree, for zero element here empty tree, so for tree b, for tree b, inorder, inorder, inorder is equals to 1, 15, 3, 20, 7 and postorder, postorder is 1, 3, 15, 7, 20, same element...