public PriorityQueue(int initialCapacity,Comparator<? super E> comparator){
  if (initialCapacity < 1) {
    throw new IllegalArgumentException();
  }
  elements=newElementArray(initialCapacity);
  this.comparator=comparator;
}

public PriorityQueue ( int initialCapacity , Comparator < ? super E > comparator ) { if ( initialCapacity < 1 ) { throw new IllegalArgumentException ( ) ; } elements = newElementArray ( initialCapacity ) ; this . comparator = comparator ; }
constructs a priority queue with the specified capacity and comparator .
