Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/trekhleb/javascript-algorithms
/ add
Method
add
src/data-structures/heap/MinHeapAdhoc.js:13–16 ·
view source on GitHub ↗
(num)
Source
from the content-addressed store, hash-verified
11
}
12
13
add(num) {
14
this.heap.push(num);
15
this.heapifyUp();
16
}
17
18
peek() {
19
return
this.heap[0];
Callers
nothing calls this directly
Calls
2
heapifyUp
Method · 0.95
push
Method · 0.80
Tested by
no test coverage detected