EPI - Q14.4 - In BST return higherKey

Q14.4: Write a function that takes a BST T and key k and returns the
first entry larger than k that would appear in an inorder walk. If k
is absent or no key larger than k is present return null.

The time complexity of this solution is O(log n), and the space
complexity is also O(log n). It requires knowledge of how to find
the inorder successor node in a BST. Alternatively a simpler solution
would be to just go inorder, O(n) time and O(1) space. In order to
qualify for the O(1) space though you would have to avoid recursion.

The book solution uses O(log n) time and O(1) space. It works
like this solution except rather than explicitly keeping track of
a path every time you go left you update a pointer to that node.
It's worth revisiting this problem and re-attempting the book's
way.