@@ -0,0 +1,948 @@
+// Given a binary tree, determine if it is a valid binary search tree (BST).%0A%0A// Assume a BST is defined as follows:%0A%0A// The left subtree of a node contains only nodes with keys less than the node's key.%0A// The right subtree of a node contains only nodes with keys greater than the node's key.%0A// Both the left and right subtrees must also be binary search trees.%0A%0A/**%0A * Definition for binary tree%0A * public class TreeNode %7B%0A *     int val;%0A *     TreeNode left;%0A *     TreeNode right;%0A *     TreeNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Apublic class Solution %7B%0A    public boolean isValidBST(TreeNode root) %7B%0A        return helper(root, Integer.MIN_VALUE, Integer.MAX_VALUE);%0A    %7D%0A%0A    public boolean helper(TreeNode node, int min, int max)%7B%0A    %09if(node == null) return true;%0A%0A    %09if(node.val %3C= min %7C%7C node.val %3E= max)%7B%0A    %09%09return false;%0A    %09%7Delse%7B%0A    %09%09return helper(node.left, min, node.val) && helper(node.right, node.val, max);%0A    %09%7D%0A    %7D%0A%7D

add validate binary search tree solution