Quantiphi interview question

code to check whether a tree is BST or not?