node* search(node* root, int data)
{
if(root==NULL||root->data==data)
{
if(root->data==data)
cout<<"Found
";
return root;
}
if(data<root->data)
return search(root->left,data);
if(data>root->data)
return search(root->right,data);
}
above code is for searching a key in a binary search tree, it is giving a warning: control reaches end of non-void function[-Wreturn-type]
how to remove this warning ? Thanks in advance
question from:https://stackoverflow.com/questions/65940698/warning-on-searching-function-of-binary-search-tree