Pregunta de entrevista de Amazon

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

Respuesta de la entrevista

Anónimo

9 may 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