如何解决c中的冲突类型错误?

时间:2020-05-09 15:16:57

标签: c conflicting-libraries implicit-declaration

我正在编写此代码以查找二叉树是否是BST,但在调用函数时遇到错误:

bool IsBST1(struct node * root){
if(root==NULL)
    return true;
if(IsSubtreeLesser(root->left,root->data) && IsSubtreeGreater(root->right,root->data) && IsBST(root->left) && IsBST(root->right)){
    return true;
   }
else{
    return false;
}

}

bool IsSubtreeLesser(struct node * root,int value){
if(root==NULL){
    return true;
}
if(root->data <= value && IsSubtreeLesser(root->left,value) && IsSubtreeLesser(root->right,value)){
    return true;
}
else{
    return false;
}

}

bool IsSubtreeGreater(struct node * root,int value){
if(root==NULL){
    return true;
}
if(root->data > value && IsSubtreeGreater(root->left,value) && IsSubtreeGreater(root->right,value)){
    return true;
}
else{
    return false;
}

}

在调用函数IsBST1时,出现以下错误: 错误:“ IsSubtreLesser”的类型冲突

0 个答案:

没有答案