I know there are ways to construct a tree from pre-order traversal (as an array). The more common question is to construct it, given the inorder and pre-order traversals. In
You don't really need the inorder traversal. There's a simple way to reconstruct the tree given only the post-order traversal:
This can easily be done either recursively or iteratively with a stack, and you can use two indices to indicate the start and end of the current sub-array rather than actually splitting the array.