heap-js
heap-js copied to clipboard
remove(o) should be O(lgn) but is implemented as O(n)
There should be an internal map from item reference to item's index, remove the item, then heapify. Current implementation searches through the entire heap array for the element.