AbstractAbstractsizeReturns the current number of elements in the heap.
The number of elements in the heap.
Abstract[iterator]Makes the AbstractHeap iterable.
Note: The traversal follows the order of the underlying array, not the priority order.
If true, the iterator will traverse the heap in reverse order.
An iterator yielding heap elements in the specified order.
AbstractaddAdds a new node to the heap while maintaining the heap property.
The node to add to the heap.
AbstractclearRemoves all elements from the heap.
AbstractdecreaseAbstractentriesReturns an iterator for traversing all elements in the heap.
Note: The traversal follows the order of the underlying array, not the priority order.
Optionalreversed: booleanIf true, the iterator will traverse the heap in reverse order.
An iterator yielding heap elements in the specified order.
AbstractforExecutes a callback function for each element in the heap.
Note: The traversal follows the order of the underlying array, not the priority order.
Element of each iteration.
The index of the current element being processed in the heap.
The heap instance being iterated.
OptionalthisArg: anyAbstractincreaseAbstractkeysReturns an iterator for traversing just the key values in the heap.
Note: The traversal follows the order of the underlying array, not the priority order.
If true, the iterator will traverse the heap in reverse order.
AbstractpeekReturns the top element of the heap without removing it.
The top element or undefined if heap is empty.
AbstractpopRemoves and returns the top element of the heap.
The removed top element or undefined if heap is empty.
AbstractremoveRemoves a specific element from anywhere in the heap.
The element to remove.
true if element was found and removed, false if not found.
An abstract base class for implementing heap data structures.
Provides a common interface for both min-heap and max-heap implementations.