98.Validate Binary Search Tree Posted on 2017-09-24 | In LeetCode Solution 1: acceptedIn-order traversal. 12345678910111213141516171819202122232425class Solution { private int last = Integer.MIN_VALUE; private boolean first = true; // for special case [-2147483648] public boolean isValidBST(TreeNode root) { if (root == null) { return true; } if (!isValidBST(root.left)) { return false; } if (!first && last >= root.val) { return false; } first = false; last = root.val; if (!isValidBST(root.right)) { return false; } return true; }}