public synchronized void insert(double _priority,Object _data){
  numElements++;
  if (numElements == queue.length) {
    PriorityQueueNode[] tmp=new PriorityQueueNode[(int)(queue.length * 1.5)];
    System.arraycopy(queue,0,tmp,0,queue.length);
    for (int i=queue.length; i < tmp.length; i++) {
      tmp[i]=new PriorityQueueNode();
    }
    queue=tmp;
  }
  queue[numElements].data=_data;
  queue[numElements].priority=_priority;
  reheapify(numElements);
}

public synchronized void insert ( double _priority , Object _data ) { numElements ++ ; if ( numElements == queue . length ) { PriorityQueueNode [ ] tmp = new PriorityQueueNode [ ( int ) ( queue . length * 1.5 ) ] ; System . arraycopy ( queue , 0 , tmp , 0 , queue . length ) ; for ( int i = queue . length ; i < tmp . length ; i ++ ) { tmp [ i ] = new PriorityQueueNode ( ) ; } queue = tmp ; } queue [ numElements ] . data = _data ; queue [ numElements ] . priority = _priority ; reheapify ( numElements ) ; }
insert the object passed with the priority value passed
