Sir Please Send the Solution

Sir please can you send the code

Hi @Gunit, If you know how to construct a binary tree using Inorder and preorder than this question is a piece of cake , now since only preorder is given , we can obtain inorder by simply sorting it . as you know the inorder traversal of bst is sorted , so now u have preorder and inorder traversals of a tree using them u can construct the tree

u can refer to this post for the algo : Construct bst from pre order

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.