is my add method in binary search tree correct I want to implement code for inserting a new Node in a binary search tree in java  so please check if my code is correct ,,, Here is my method :

public class BinarySearchTree {
      …

      public boolean add(int value) {
            if (root == null) {
                  root = new BSTNode(value);
                  return true;
            } else
                  return root.add(value);
      }
}
        public class BSTNode {
         …

      public boolean add(int value) {
            if (value == root.data)
                  return false;
            else if (value &lt;root.data) {
                  if (root.left == null) {
                        root.left = new BSTNode(value);
                        return true;
                  } else
                        return root.left.add(value);
            } else if (value &gt; root.data) {
                  if (root.right == null) {
                        root.right = new BSTNode(value);
                        return true;
                  } else
                        return root.right.add(value);
            }
            return false;
      }
}
It looks to be correct.

However this code can result in unbalanced trees (like if you add all numbers in increasing order).

To keep it balanced you can use the techniques described for self-balancing trees