I tried this, but I am getting compile time error. What I am missing ? I also have to return false if the element not found
public boolean search(Node root, Node node){
if(root==node){
return true;
}
if(root.getLeft()!=null){
search(root.getLeft(), node);
}
if(root.getRight()!=null){
search(root.getRight(), node);
}
}