public void add(Comparable x){
  items.add(null);
  size+=1;
  int hole=size;
  items.set(0,x);
  for (; x.compareTo(items.get(hole / 2)) < 0; hole/=2) {
    items.set(hole,items.get(hole / 2));
  }
  items.set(hole,x);
}

public void add ( Comparable x ) { items . add ( null ) ; size += 1 ; int hole = size ; items . set ( 0 , x ) ; for ( ; x . compareTo ( items . get ( hole / 2 ) ) < 0 ; hole /= 2 ) { items . set ( hole , items . get ( hole / 2 ) ) ; } items . set ( hole , x ) ; }
insert into the priority queue . duplicates are allowed .
