Item delete(Heap h) { Item top = h->items[1]; // overwrite first by last h->items[1] = h->items[h->nitems]; h->nitems--; // move new root to correct position fixDown(h->items, 1, h->nitems); return top; }