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
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