#include <cstddef>
#include <climits>
/**
 * Definition for a binary tree node.
 */
struct TreeNode {
    int val;
    TreeNode *left;
    TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class Solution {
public:
    bool isValidBSTInternal(TreeNode* root, int minVal, int maxVal)
    {
        if (root == NULL) {
            return true;
        }

	return (root->val > minVal &&
		root->val < maxVal &&
		isValidBSTInternal(root->left, minVal, root->val) &&
		isValidBSTInternal(root->right, root->val, maxVal));
    }

    bool isValidBST(TreeNode* root) {
        
        return isValidBSTInternal(root, INT_MIN, INT_MAX);
    }
};

/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     TreeNode *left;
 *     TreeNode *right;
 *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
 * };
 */
class Solution {
public:
    bool isValidBSTInternal(TreeNode* root, int minVal, int maxVal)
    {
        if (root == NULL) {
            return true;
        }

	return (root->val > minVal &&
		root->val < maxVal &&
		isValidBSTInternal(root->left, minVal, root->val) &&
		isValidBSTInternal(root->right, root->val, maxVal));
    }

    bool isValidBST(TreeNode* root) {
        int minVal, maxVal;
        return isValidBSTInternal(root, LONG_MIN, LONG_MAX);
    }
};

--- 
+++ 
@@ -1,12 +1,15 @@
+#include <cstddef>
+#include <climits>
 /**
  * Definition for a binary tree node.
- * struct TreeNode {
- *     int val;
- *     TreeNode *left;
- *     TreeNode *right;
- *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}
- * };
  */
+struct TreeNode {
+    int val;
+    TreeNode *left;
+    TreeNode *right;
+    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
+};
+
 class Solution {
 public:
     bool isValidBSTInternal(TreeNode* root, int minVal, int maxVal)
@@ -22,7 +25,7 @@
     }
 
     bool isValidBST(TreeNode* root) {
-        int minVal, maxVal;
-        return isValidBSTInternal(root, LONG_MIN, LONG_MAX);
+        
+        return isValidBSTInternal(root, INT_MIN, INT_MAX);
     }
 };
Clean up of the code.
