private void heapifyDown(Comparable<Object> cur){
  final int stop=size >>> 1;
  int twopos=0;
  while (twopos < stop) {
    int bestchild=(twopos << 1) + 1;
    Comparable<Object> best=twoheap[bestchild];
    final int right=bestchild + 1;
    if (right < size && best.compareTo(twoheap[right]) < 0) {
      bestchild=right;
      best=twoheap[right];
    }
    if (cur.compareTo(best) >= 0) {
      break;
    }
    twoheap[twopos]=best;
    twopos=bestchild;
  }
  twoheap[twopos]=cur;
}

private void heapifyDown ( Comparable < Object > cur ) { final int stop = size > > > 1 ; int twopos = 0 ; while ( twopos < stop ) { int bestchild = ( twopos << 1 ) + 1 ; Comparable < Object > best = twoheap [ bestchild ] ; final int right = bestchild + 1 ; if ( right < size && best . compareTo ( twoheap [ right ] ) < 0 ) { bestchild = right ; best = twoheap [ right ] ; } if ( cur . compareTo ( best ) >= 0 ) { break ; } twoheap [ twopos ] = best ; twopos = bestchild ; } twoheap [ twopos ] = cur ; }
invoke heapify - down for the root object .
