private void _insert(int value, Node cur_node) { if (value < cur_node.getValue()) { if (cur_node.getLeftNode() == null) { cur_node.setLeftNode(new Node(value)); } else { this._insert(value, cur_node.getLeftNode()); } } else if (value > cur_node.getValue()) { if (cur_node.getRightNode() == null) { cur_node.setRightNode(new Node(value)); } else { this._insert(value, cur_node.getRightNode()); } } else { Console.WriteLine("Value already exists in tree."); } }