Class
BinaryHeap
:_items
: T[]_compareFn
: (a: T, b: T) => booleaninsert
(item: T) => voidInsert an item into the binary heap
remove
() => T | nullRemove the smallest item from the binary heap in case of a min heap or the greatest item from the binary heap in case of a max heap
clear
() => voidRemove all items
moveUp
(pos: number) => voidmoveDown
(pos: number) => voidswap
(index1: number, index2: number) => voidlength
(): numberReturns the amount of items