Write C code to search for a value in a binary search tree (BST).
Here are a few C programs....
Here is another way to do the same
mynode *search(int value, mynode *root)
{
while(root!=NULL && value!=root->value)
{
root = (value < root->value)?root->left:root->right;
}
return(root);
}
mynode *recursive_search(int item, mynode *root)
{
if(root==NULL || item == root->value){return(root);}
if(iteminfo)return{recursive_search(item, root->left);}
return{recursive_search(item, root->right);}
}
