Amazon interview question

Write a code to find out if a tree is a binary search tree.