Frage im Vorstellungsgespräch bei Amazon

write a function to check if a binary tree is a binary search tree.

Antwort im Vorstellungsgespräch

Anonym

9. Mai 2012

Here is the functionality that needs to be implemented. 1. Do an inorder traversal. 2. Check if the elements that are visited are in non-decreasing order. 3. If all the elements are in non-decreasing order, then it is a BST. 4. Else not a BST.

1