Construct BST from PREORDER

sorting the preorder array will yield the inorder traversal of the tree. But making BST from inorder and preorder will also be done in O(N^2). How can we build in O(n) complexity then using inorder and preorder

@krikhi Refer this article


O(n) approach is also explained.