Error in checking the BST

Not giving correct output of inorder traversal of 1 3 5 4 7 8 10 -1 as it is the example of the video in which , sir has taught that it is not a BST but this code is showing it as BST. I am not able to find error in the code .

Code -> https://sapphireengine.com/@/yuz7bb

you are building bst from the given input
and then checking is it a bst ? :grinning:
it will always a bst

first form binary tree from given input and then check whether it is bst or not?