title: Binary search tree boolean return type
body: <p>This is a function that add a node in my binary search tree.How can i reformat that to return true if  this tree did not already contain the specified element.</p>
  <pre><code>private Node insertNode(Node root, Student student) {
      if (root == null) {
          root = new Node(student);
      }
      int comp;
      if (Comparator != null) {
          comp = Comparator.compare(student, root.value);
      } else {
          comp = student.compareTo(root.value);
      }
  
      if (comp &lt; 0) {
          root.left = insertNode(root.left, student);
      } else if (comp &gt; 0) {
          root.right = insertNode(root.right, student);
      }
      return root;
  }
  </code></pre>