public void insertRight(BTNodeWithParent<T> right) { right.setLeft(this.getRight().getLeft()); right.setRight(this.getRight().getRight()); right.setParent(this); right.getLeft().setParent(right); right.getRight().setParent(right); this.setRight(right); }
public void insertLeft(BTNodeWithParent<T> left) { left.setLeft(this.getLeft().getLeft()); left.setRight(this.getLeft().getRight()); left.setParent(this); left.getLeft().setParent(left); left.getRight().setParent(left); this.setLeft(left); }