Amazon Interview Question: given a node in a binary sear... | Glassdoor

Interview Question

Software Development Engineer Intern Interview

given a node in a binary search tree, find the next highest

  value (in-order successor) assuming that the nodes have a parent link

Interview Answer

2 Answers


Why do you need parent link? Shouldn't this be the left-most child of the right child?

jamie on Feb 9, 2014

Parent would be needed in case the given node is a leaf node.

Abhishek on Feb 17, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.