Amazon interview question

write a function to determine a BST