Google interview question

"write a function stating whether or not an input tree was a valid binary search tree"