Write a function for searching an element in a binary tree.
Difficulty level
This exercise is mostly suitable for students
int find(Btree B, element e)
{
if(B)
{
if(B->data==e)
return 1;
return find(B->left, e) || find(B->right,e);
}
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
UVA 1112 - Mice and Maze