मैं पता लगाना है कि मेरी खोज समारोह मेरी द्विआधारी पेड़ यह जड़ के लिए सच रिटर्न लेकिन मैं पेड़ के बाकी traversing के बारे में जाने के लिए पता नहीं कैसे के लिए काम करने के लिए प्राप्त करने के लिए समस्या हो रही है।
public boolean contains(Object e)
{
return search(root, e);
}
private boolean search(BinaryNode n, Object e)
{
//If the current node is null,
//then the value clearly isn't found and return false.
if (n == null)
{
return false;
}
//If the node contains the search value,
//then the value is found and return true.
if(n.getValue() == e)
{
return true;
}
//If the node isn't null but also doesn't contain the search value,
//then search both the left and right subtrees
return false;
}













