lib/heap.c
/* Removes 'node' from 'heap', without maintaining the heap invariant.
 *
 * After this call, heap_max() will no longer necessarily return the maximum
 * value in the heap, and HEAP_FOR_EACH will no longer necessarily iterate in
 * heap level order, until the next call to heap_rebuild(heap).
 *
 * This takes time O(1). */
Removes 'node' from 'heap', without maintaining the heap invariant.
After this call, heap_max() will no longer necessarily return the maximum
value in the heap, and HEAP_FOR_EACH will no longer necessarily iterate in
heap level order, until the next call to heap_rebuild(heap).


Removes ' node ' from ' heap ' without maintaining the heap invariant . After this call heap_max () will no longer necessarily return the maximum value in the heap and HEAP_FOR_EACH will no longer necessarily iterate in heap level order until the next call to heap_rebuild ( heap ) .
void
heap_raw_remove(struct heap *heap, struct heap_node *node)
{
    size_t i = node->idx;
    if (i < heap->n) {
        put_node(heap, heap->array[heap->n], i);
    }
    heap->n--;
}
void heap_raw_remove ( struct heap * heap , struct heap_node * node ) { size_t i = node -> idx ; if ( i < heap -> n ) { put_node ( heap , heap -> array [ heap -> n ] , i ) ; } heap -> n -- ; }
Removes 'node' from 'heap', without maintaining the heap invariant.
Removes ' node ' from ' heap ' without maintaining the heap invariant .