0

i got it success but error and i cant find it

my code here:

```
bool BinarySearchTree::search(int d)
{
tree_node *t = head;
if(root==NULL)
cout<<" The Tree is empty. Please insert a value "<<endl;
while (t != NULL)
{
if (t->data == d)
break;
else if (d > t->data)
t = t->right;
else
//(d < t->data)
t = t->left;
}
if (t == NULL)
return false;
if (t->data == d)
cout << "found" <<endl;
return true;
return false;
}
```