Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/trekhleb/javascript-algorithms
/ add
Method
add
src/data-structures/heap/Heap.js:139–143 ·
view source on GitHub ↗
* @param {*} item * @return {Heap}
(item)
Source
from the content-addressed store, hash-verified
137
* @
return
{Heap}
138
*/
139
add(item) {
140
this.heapContainer.push(item);
141
this.heapifyUp();
142
return
this;
143
}
144
145
/**
146
* @param {*} item
Callers
5
instantiateHeap
Function · 0.95
MinHeap.test.js
File · 0.45
MinHeapAdhoc.test.js
File · 0.45
MaxHeapAdhoc.test.js
File · 0.45
MaxHeap.test.js
File · 0.45
Calls
2
heapifyUp
Method · 0.95
push
Method · 0.80
Tested by
1
instantiateHeap
Function · 0.76