This problem was asked by Amazon.
Given a node in a binary search tree, return the next bigger element, also known as the inorder successor.
For example, the inorder successor of 22 is 30.
10
/ \
5 30
/ \
22 35
You can assume each node has a parent pointer.