public void changeKey(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");
  Key tmp=keys[i + d];
  keys[i + d]=key;
  if (comp.compare(key,tmp) <= 0) {
    swim(qp[i + d]);
  }
 else {
    sink(qp[i + d]);
  }
}

public void changeKey ( 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" ) ; Key tmp = keys [ i + d ] ; keys [ i + d ] = key ; if ( comp . compare ( key , tmp ) <= 0 ) { swim ( qp [ i + d ] ) ; } else { sink ( qp [ i + d ] ) ; } }
changes the key associated with index i to the given key if the given key is greater , worst case is o ( d * log - d ( n ) ) if the given key is lower , worst case is o ( log - d ( n ) )
