1,lintcode 95. Validate Binary Search Tree class Solution { public : /** * @param root: The root of binary tree. * @return: True if the binary tree is BST, or false */ bool isValidBST (TreeNode * root) { // write your code here if (root == NULL ){ return true ; } if (root->left == NULL && root->right == NULL ){ return true ; } if (root->left != NULL ){ if (root->left->val < root->val){ if (root->left->right != NULL && root->left->right->val >= root->val){ //开始debug第一轮,这个条件忽略了。 return false ; //注意这个条件,在分问题中不能解决的条件,要放在分前解决 } } else { return false ; } } if (root->right != NULL ){ if (root->right->val > root->val){ if (root->right->left != NU...