Amazon.com

  www.amazon.com
Work in HR? Unlock Free Profile

Amazon.com Software Development Engineer Intern Interview Question

I interviewed in Seattle, WA and was asked:
"Hasp map concepts theory questions coding question : Program to check if binary tree is a BST Complexity of the module written"
Add Tags [?]
Answer

Part of a Software Development Engineer Intern Interview Review - one of 4,645 Amazon.com Interview Reviews

Answers & Comments

1
of 1
vote
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
0
of 0
votes
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

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.