node* bstse(node *bt,int a)
{
if(bt==NULL)//空树
{
return NULL;
}
else
{
if(bt->data==a)
{
return bt;
}
else if(a<bt->data)
{
bstse(bt->left,a);
}
else
{
bstse(bt->right,a);
}
}
}
在主函数里接收返回值,进行判断
node* bstse(node *bt,int a)
{
if(bt==NULL)//空树
{
return NULL;
}
else
{
if(bt->data==a)
{
return bt;
}
else if(a<bt->data)
{
bstse(bt->left,a);
}
else
{
bstse(bt->right,a);
}
}
}
在主函数里接收返回值,进行判断