Work in HR? Unlock Free Profile Software Development Engineer Intern Interview Question

"Write a function to determine if a tree is a BST."
Add Tags [?]

Part of a Software Development Engineer Intern Interview Review - one of 4,635 Interview Reviews

Answers & Comments

of 0
Use in-order traversal or track the minimum and maximum for each node and recurse for the entire tree. Return false if the condition is broken; true if it holds for the given tree. (Be careful: the minimum/maximum condition should hold across all levels!)
- Interview Candidate on Sep 15, 2013

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.