binary tree insertion 3
<p>I am trying to write my own binary tree and I have problems with insertion. The values in tree are duplicated. I have inner static class Node with "Node right,left and int value" fields and outer class BinaryTree with one field - Node root.</p>

<p>The code of insertion:</p>

<pre><code>public void insert(int number) {
    if (root.isEmpty())
        root.value = number;
    else {
        Node node = root;
        insert(number, node);
    }
}

private void insert(int number, Node node) {
    if (number &lt; node.value &amp;&amp; node.left != null) {
        node = node.left;
        insert(number, node);
    } else {
        if (node.left == null)
            node.left = new Node(null, null, number);
    }

    if (number &gt; node.value &amp;&amp; node.right != null) {
        node = node.right;
        insert(number, node);
    } else {
        if (node.right == null)
            node.right = new Node(null, null, number);
    }
}
</code></pre>

<p>What i am doing wrong?</p>
