SIr
- Do we need to sort given array and then pass it on to the function to construct BST ??
- What should be the preorder traversal of given input:
4, 3, 2, 5, 6 ??
SIr
My output of preorder is : 4 2 3 5 6
As per the qn first u have to form the bst then
then uske baad operations karne hai
we can form the bst w/o sorting the array
then perform the given operations
if we have to make search operation first then we have to sort the array for binary search
but agar bst form karna hai
to pehle form kar lo
then usse pe search or preorder traversal kar lena
preorder traversal will be 4, 3, 2, 5, 6
becoz
4 ke left me 3, 3 ke left me 2
4 ke right me 5, 5 ke right me 6
i hope it will help u
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.