Check if a binary tree is BST or not