Get the reserved capacity of this heap.
Reserve enough space in this heap for value elements. The reserved space is truncated or extended as necessary. If the value is less than the number of elements already in the heap, throw an exception.
Reset this heap.
reset this heap, and use the provided host for value elements
Return a shallow copy of this heap.
Gets the value at the top of the heap without removing it.
Removes the top of this heap and returns it.
Inserts the given element into the heap.
Inserts all elements in the given array into the heap.
Remove the first instance that matches the given item. * Returns: true iff the item was found, otherwise false.
Remove the every instance that matches the given item.
Remove the element at the given index from the heap. * The index is according to the heap's internal layout; you are * responsible for making sure the index is correct. * The heap invariant is maintained.
Returns the number of elements in this heap.
A heap is a data structure where you can insert items in random order and extract them in sorted order. * Pushing an element into the heap takes O(lg n) and popping the top of the heap takes O(lg n). Heaps are * thus popular for sorting, among other things. * * No opApply is provided, since most people would expect this to return the contents in sorted order, * not do significant heap allocation, not modify the collection, and complete in linear time. This * combination is not possible with a heap. * * Note: always pass by reference when modifying a heap. * * The template arguments to the heap are: * T = the element type * Compare = a function called when ordering elements. Its signature should be bool(T, T). * see minHeapCompare() and maxHeapCompare() for examples. * Move = a function called when swapping elements. Its signature should be void(T, size_t). * The default does nothing, and should suffice for most users. You * probably want to keep this function small; it's called O(log N) * times per insertion or removal.