Ejemplo n.º 1
0
  /* really __gl_pqSortMinimum */
  Object pqMinimum() {
    Object sortMin, heapMin;

    if (size == 0) {
      return heap.pqMinimum();
    }
    sortMin = keys[order[size - 1]];
    if (!heap.pqIsEmpty()) {
      heapMin = heap.pqMinimum();
      if (com.sun.opengl.impl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
        return heapMin;
      }
    }
    return sortMin;
  }
Ejemplo n.º 2
0
  /* really __gl_pqSortExtractMin */
  Object pqExtractMin() {
    Object sortMin, heapMin;

    if (size == 0) {
      return heap.pqExtractMin();
    }
    sortMin = keys[order[size - 1]];
    if (!heap.pqIsEmpty()) {
      heapMin = heap.pqMinimum();
      if (LEQ(leq, heapMin, sortMin)) {
        return heap.pqExtractMin();
      }
    }
    do {
      --size;
    } while (size > 0 && keys[order[size - 1]] == null);
    return sortMin;
  }
Ejemplo n.º 3
0
 /* really __gl_pqSortIsEmpty */
 boolean pqIsEmpty() {
   return (size == 0) && heap.pqIsEmpty();
 }