Main question was verifying whether a binary tree was a BST, given the function header that looked like public boolean isBST(root). He stated no other functions could be created and that child nodes did not have links to their parents.
Anonymous
He was looking for me to use a helper function to pass the parent's value in. boolean isBST(Node root) { return isBSTHelper(root.left, root.value, isLeft) && isBSTHelper(root.right, root.value, isRight); } something similar to this. Since he told me I could not use extra functions I could not come up with an answer which is why I am bitter / negative about this interview.
Check out your Company Bowl for anonymous work chats.