Please check code for Print BST keys in given range


Getting run error

hello @sahilkhan2312000131
the given input is not a preorder traversal.
so the method that u r using to construct the tree is wrong.
build a normal bst by inserting elements one by one and then apply ur logic

Coding Blocks IDE
Please check this code

u commited the same mistake again.

…
see the built function of this code->

Can u please give any test case where my code runs wrong

…

bro u r assuming that the given input is the preorder of the bst tree,
which is clearly wrong, nowhere they have mentioned thaT the given input is the preorder.

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.