Given a binary tree, determine whether it is a binary search tree or not.
Example, the tree given below should return False.
Considering the properties of a binary search tree, we can derive at the conclusion that for a binary tree to be a binary search tree, each node has a range of value that is allowed for it.
For example, the left child of the root can have values in the range (-infinity to root.value).
Similarly, right child of the root can have values in the range (root.value, +infinity).
Using this observation we can devise an algorithm such that for each node we pass a valid range for its value and check if it has a valid value or not.