Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.
Example:
Note: There are at least two nodes in this BST.
解法1:
in-order的traversal是一个排序过后的数组,用一个prev记录上一次访问过的node,然后相邻的比较一下。
用一个global variable寄存
C++
Java