Something
public text v1 · immutableREKURSIVT med referens:
/**
* Insert a new item in tree.
* @param x the item to insert.
*/
public void insert(E x) {
insert(x, root);
}
/* Insert the element x into the subtree with root n */
private void insert(E x, BinaryNode<E> &n) {
if(n == null) {
n = new BinaryNode<E>(x);
} elseif (n.getElement().compareTo(x) > 0) {
insert(x, n.getLeft());
} else {
insert(x, n.getRight());
}
}