First version of the valid bst problem.  Should work as is, suffer from some limitation of the Leetcode online judge system.  

It uses a global 'temp' variable to pass the value around. Note that the proposed algorithm, which is based on in-order traverse, in http://leetcode.com/2010/09/determine-if-binary-tree-is-binary.html#comment-34559, does not work. The local updated variable does not propagate to the next level in the recursion stack.
Second version of the valid bst problem.

HAKMEM: projecting segment.