public void decreaseKey(int i,Key key){
  if (i < 0 || i >= nmax)   throw new IndexOutOfBoundsException();
  if (!contains(i))   throw new NoSuchElementException("Specified index is not in the queue");
  if (comp.compare(keys[i + d],key) <= 0)   throw new IllegalArgumentException("Calling with this argument would not decrease the Key");
  keys[i + d]=key;
  swim(qp[i + d]);
}

public void decreaseKey ( int i , Key key ) { if ( i < 0 || i >= nmax ) throw new IndexOutOfBoundsException ( ) ; if ( ! contains ( i ) ) throw new NoSuchElementException ( "Specified index is not in the queue" ) ; if ( comp . compare ( keys [ i + d ] , key ) <= 0 ) throw new IllegalArgumentException ( "Calling with this argument would not decrease the Key" ) ; keys [ i + d ] = key ; swim ( qp [ i + d ] ) ; }
decreases the key associated with index i to the given key worst case is o ( log - d ( n ) )
