@@ -0,0 +1,477 @@
+public class LeetCode0098 %7B%0A%0A%09class TreeNode %7B%0A%09%09int val;%0A%09%09TreeNode left;%0A%09%09TreeNode right;%0A%0A%09%09TreeNode(int x) %7B%0A%09%09%09val = x;%0A%09%09%7D%0A%09%7D%0A%0A%09public boolean isValidBST(TreeNode root) %7B%0A%09%09return dfs(root, Long.MIN_VALUE, Long.MAX_VALUE);%0A%09%7D%0A%0A%09private boolean dfs(TreeNode root, long min, long max) %7B%0A%09%09if (root == null) %7B%0A%09%09%09return true;%0A%09%09%7D%0A%09%09if (root.val %3C= min %7C%7C root.val %3E= max) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09return dfs(root.left, min, root.val) && dfs(root.right, root.val, max);%0A%09%7D%0A%7D

Add LeetCode0098.java