YSMull
<-- algorithm



原题链接
class Solution {
    public boolean isValidBST(TreeNode root) {
        LinkedList<TreeNode> stk = new LinkedList<>();
        TreeNode p = root;
        Integer last = null;
        while (!stk.isEmpty() || p != null) {
            while (p != null) {
                stk.push(p);
                p = p.left;
            }
            p = stk.pop();
            if (last != null && p.val <= last) return false;
            last = p.val;
            p = p.right;
        }
        return true;
    }
}