public void insert(E obj){
  int i;
  i=++_n;
  E p;
  while (i > 1) {
    int pIdx=i / 2;
    p=_elements[pIdx];
    if (comparator.compare(obj,p) > 0) {
      break;
    }
    _elements[i]=p;
    i=pIdx;
  }
  _elements[i]=obj;
}

public void insert ( E obj ) { int i ; i = ++ _n ; E p ; while ( i > 1 ) { int pIdx = i / 2 ; p = _elements [ pIdx ] ; if ( comparator . compare ( obj , p ) > 0 ) { break ; } _elements [ i ] = p ; i = pIdx ; } _elements [ i ] = obj ; }
insert the object into the binaryheap
