Amazon Interview Question

Write production quality code to find whether a given binary tree is a BST or not. You can't make any global variable.

Interview Answer

Anonymous

Dec 11, 2010

if all the values are integers, then do an in-order traversal and see if the elements are in sorted order