Amazon Interview Question

Hasp map concepts theory questions coding question : Program to check if binary tree is a BST Complexity of the module written

Interview Answers

Anonymous

May 9, 2012

checking the value of node with its children every level, pointed the disadvantage of the solution and gave me a hint. Solution: In-order traversal

1

Anonymous

Nov 21, 2012

Do In-Order Traversal Check if it is sorted in ascending order, if yes then the tree is BST. Time Complexity: O(n)