This code is giving yes for all cases in my compiler but here it's showing compilation error

Please let me know the mistake in this code
(isBST)

in ide it is showing compilation error because in your input -1 is not present

But why is the output yes for all cases

Please reply …?

output will be obviously yes for all testcases
because you are building bst :smile:

you have to build binary tree and then check whether binary tree is Bst or not?
if you build bst then it will always be bst

okay thank you so much

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.