public void push ( int element ) { if ( element < 0 ) throw new IllegalArgumentException ( "Cannot add negative integers to the priority queue" ) ; assert ! this . contains ( element ) ; this . doImport ( element ) ; this . pos . set ( element , this . heap . size ( ) ) ; this . heap . push ( element ) ; assert this . heap . get ( this . pos . get ( element ) ) == element ; this . up ( element ) ; }
Pushes a new positive element to the queue .