Amazon Interview Question: Hasp map concepts theory ques... | Glassdoor

Interview Question

Software Development Engineer Intern Interview Seattle, WA

Hasp map concepts theory questions coding question

  : Program to check if binary tree is a BST Complexity of the module written

Interview Answer

2 Answers


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

Interview Candidate on May 9, 2012

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

T on Nov 20, 2012

Add Answers or Comments

To comment on this, Sign In or Sign Up.