Construct Binary Tree from Inorder and Postorder Traversal

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

Solution: The last element in postorder vector is the root. The root divides the inorder vector into two parts.

Comments

Popular posts from this blog

Maximum Gap

Binary Tree Maximum Path Sum

[ITint5] Maximum Subarray for a Circular Array