include/indexedHeap.h
void erase(size_t R) {
    size_t I=_rev[R];
    if (I==0) return;    		// already gone; done
    if (I==size()) { 				// if last, can just remove without breaking heap
      _rev[R]=0; _p.pop_back(); _id.pop_back(); 
    } else {
      heapSwap(I,size()); 	// otherwise, swap with the end of the heap
      _rev[R]=0; _p.pop_back(); _id.pop_back();		// remove R
      maxHeapify(I);				// and then push the old end down until it's heapified
    }
  }
// Remove index R from the heap
Remove index R from the heap
Remove index R from the heap
void erase(size_t R) {
    size_t I=_rev[R];
    if (I==0) return;    		
    if (I==size()) { 				
      _rev[R]=0; _p.pop_back(); _id.pop_back(); 
    } else {
      heapSwap(I,size()); 	
      _rev[R]=0; _p.pop_back(); _id.pop_back();		
      maxHeapify(I);				
    }
  }
void erase ( size_t R ) { size_t I = _rev [ R ] ; if ( I == 0 ) return ; if ( I == size ( ) ) { _rev [ R ] = 0 ; _p . pop_back ( ) ; _id . pop_back ( ) ; } else { heapSwap ( I , size ( ) ) ; _rev [ R ] = 0 ; _p . pop_back ( ) ; _id . pop_back ( ) ; maxHeapify ( I ) ; } }
Remove index R from the heap
Remove index R from the heap
// already gone; done // if last, can just remove without breaking heap // otherwise, swap with the end of the heap // remove R // and then push the old end down until it's heapified