ool checkBST(Node* root,int minV=INT_MIN,int maxV=INT_MAX) {
if(root==NULL){
return true;
}
if(root->data<=maxV &&root->data>=minV && checkBST(root->left,minV,root->data) && checkBST(root->right,root->data,maxV) ){
return true;
}
return false;
}
can anyone please tell me what to correct in my code if the tree has duplicate values?