Amazon Interview Question

Function to detect if Binary tree is BST.