98. 验证二叉搜索树c
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* struct TreeNode *left;
* struct TreeNode *right;
* };
*/
long pre;
bool inorder(struct TreeNode* root){
if(!root) return true;
bool a=inorder(root->left);
if(root->val <=pre) return false;
pre=root->val;
bool b=inorder(root->right);
return a&b;
}
bool isValidBST(struct TreeNode* root) {
pre=LONG_MIN;
return inorder(root);
}