Whats the difference between
return(checkBst(root->left, minvalue, root) && checkBst(root->right, root, maxvalue));
and
return(checkBst(root->left, minvalue, root));
return(checkBst(root->right, root, maxvalue));
My whole programme looks like this
bool checkBst(node *root, node * minvalue, node * maxvalue){
if(root == NULL){
return true;
}
if((minvalue && root->data <= minvalue->data) || (maxvalue && root->data >= maxvalue->data)){
return false;
}
return(checkBst(root->left, minvalue, root) && checkBst(root->right, root, maxvalue));
// return(checkBst(root->left, minvalue, root));
// return(checkBst(root->right, root, maxvalue));
}