Does the equals() method work on this Binary Tree?
<p>I wrote a method that checks if two binary tree are equal.</p>

<p>Is this correct or is there a better way? </p>

<pre><code>public  boolean equal(BinaryNode t1, BinaryNode t2){  
    if(t1==null || t2==null)  
        return false;  
    else if(t1.element != t2.element)  
        return false;  
    else if(equal(t1.left,t2.left))   
        return false;  
    else if(equal(t1.right,t2.right))   
        return false;  
    else  
        return true;
}  
</code></pre>
