RethinkDB interview question

Check whether a given tree is a bst or not.