Skip to content

Latest commit

 

History

History
13 lines (11 loc) · 290 Bytes

README.md

File metadata and controls

13 lines (11 loc) · 290 Bytes

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.