Facebook friends
Coding questionThis question is similar to the "Route Between Nodes" from this book.
Problem
Consider a popular social networking website, Facebook for example. People can create their own profile and add friends.
Given two Facebook profiles, I want to…
Validate BST
Coding questionMy usual mistake for this problem:
You can not just compare node.left.value < node.value < node.right.value.
This does not handle edge cases such as:
10
/ \
5 20
\
20
20…