Build bst error


my code is compiling but giving the wrong answer.

the method u are applying is not right
u need to take the entire array input then build the tree

But what is the mistake with the code I was trying to submit?Because I know about this method only.I tried your code and it worked,Thanks for that :slightly_smiling_face:

so the problem is
that u need to take n inputs
u simply are taking cin >>n not using it
u need to take n inputs
andthe build tree from that

1 Like

Thankyou very much :slightly_smiling_face: :slightly_smiling_face:

1 Like

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.