Checks if a binary tree is a binary search tree or not