boolean contains(BinarySearchTreeNode<E> node){
  if (node == null)   return false;
  if (this.root == null)   return false;
  if (node == this.root)   return true;
  BinarySearchTreeNode<E> curr=this.root;
  while (curr != null) {
    if (curr == node)     return true;
    int diff=node.compareTo(curr);
    if (diff == 0) {
      return curr == node;
    }
 else     if (diff < 0) {
      curr=curr.left;
    }
 else {
      curr=curr.right;
    }
  }
  return false;
}

boolean contains ( BinarySearchTreeNode < E > node ) { if ( node == null ) return false ; if ( this . root == null ) return false ; if ( node == this . root ) return true ; BinarySearchTreeNode < E > curr = this . root ; while ( curr != null ) { if ( curr == node ) return true ; int diff = node . compareTo ( curr ) ; if ( diff == 0 ) { return curr == node ; } else if ( diff < 0 ) { curr = curr . left ; } else { curr = curr . right ; } } return false ; }
returns true if the given node ( not the node ' s comparable ) is contained in this tree . < p > this method performs a reference equals comparison on the nodes rather than a comparison on the node ' s comparable .
