pop method

dynamic pop()

Returns the item with the highest priority and removes it from the priority queue.

Implementation

pop() {
	if ( length == 0 ) return null;

	final top = data[ 0 ];
	length --;

	if ( length > 0 ) {
		data[ 0 ] = data[ length ];
		_down( 0 );
	}

	data.removeLast();

	return top;
}