We can clearly observe that first element of preorder traversal array is the root value of the tree. We now look for the position of this root value in the inorder traversal array. I use a element-to-index map for O(1) access to this position of root value in inorder traversal array. The array will be now split into left subtree and right subtree around this position. Now we recurse once for left subtree and once for right subtree while sending proper arguments. <br/>At each step of recursion, we return a node having value as first element of preorder traversal array for that sub-tree. This method can be used if postorder traversal array is given as well. In that case, at each step we return the node having value as last element of postorder traversal array.<br/>Time complexity is O(N) and space complexity is O(N) due to element-to-index map.