public void clear() {
    // clean up references in the array for memory management
    for(int i = 0; i < size; i++) {
      queue[i] = null;
    }
    this.size = 0;
    heapModified();
  }
public void clear ( ) { for ( int i = 0 ; i < size ; i ++ ) { queue [ i ] = null ; } this . size = 0 ; heapModified ( ) ; }
Clear the heap.