All pastes #231246 Raw Edit

Anonymous

public text v1 · immutable
#231246 ·published 2006-10-31 18:26 UTC
rendered paste body
 
	public void insert(E x) {
		root = insert((Comparable)x, root);
	}

	protected BinaryNode insert( Comparable x, BinaryNode t ) {
        if(t == null)
            t = new BinaryNode(x);
        else if(x.compareTo(t.element) < 0)
            t.left = insert(x, t.left);
        else
            t.right = insert(x, t.right);
        
        return t;
        }