Heap instance constructor.
Optional comparison function, defaults to Heap.minComparator
Optional comparison function, defaults to Heap.minComparator
Alias of peek
Alias of add
Alias of pop
Length of the heap.
Get length limit of the heap.
Set length limit of the heap.
Returns the comparison function.
Returns true if this queue contains the specified element.
Element to be found
Optional comparison function, receives (element, needle)
Remove an element from the heap.
Optional
o: TElement to be found
Optional function to compare
True if the heap was modified
Static
defaultStatic
getStatic
getStatic
getStatic
heapbottomReturn the n
least valuable elements of a heap-like Array
Array, should be an array-heap
Max number of elements
Optional
compare: AsyncComparator<N>Optional compare function
Elements
Static
heapifyConverts an array into an array-heap, in place
Array to be modified
Optional
compare: AsyncComparator<N>Optional compare function
For convenience, it returns a Heap instance
Static
heappopExtract the peek of an array-heap
Array to be modified, should be a heap
Optional
compare: AsyncComparator<N>Optional compare function
Returns the extracted peek
Static
heappushPushes a item into an array-heap
Array to be modified, should be a heap
Item to push
Optional
compare: AsyncComparator<N>Optional compare function
Static
heappushpopPush followed by pop, faster
Array to be modified, should be a heap
Item to push
Optional
compare: AsyncComparator<N>Optional compare function
Returns the extracted peek
Static
heapreplaceReplace peek with item
Array to be modified, should be a heap
Item as replacement
Optional
compare: AsyncComparator<N>Optional compare function
Returns the extracted peek
Static
heaptopReturn the n
most valuable elements of a heap-like Array
Array, should be an array-heap
Max number of elements
Optional
compare: AsyncComparator<N>Optional compare function
Elements
Static
maxStatic
maxStatic
minStatic
minStatic
nlargestReturn the n
most valuable elements of an iterable
Max number of elements
Optional
compare: AsyncComparator<N>Optional compare function
Elements
Static
nsmallestReturn the n
least valuable elements of an iterable
Max number of elements
Optional
compare: AsyncComparator<N>Optional compare function
Elements
Static
printPrints a heap.
Heap to be printed
Generated using TypeDoc
Heap