Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/trekhleb/javascript-algorithms
/ peek
Method
peek
src/data-structures/heap/Heap.js:106–112 ·
view source on GitHub ↗
* @return {*}
()
Source
from the content-addressed store, hash-verified
104
* @
return
{*}
105
*/
106
peek() {
107
if
(this.heapContainer.length === 0) {
108
return
null;
109
}
110
111
return
this.heapContainer[0];
112
}
113
114
/**
115
* @
return
{*}
Callers
6
MinHeap.test.js
File · 0.45
MinHeapAdhoc.test.js
File · 0.45
MaxHeapAdhoc.test.js
File · 0.45
MaxHeap.test.js
File · 0.45
PriorityQueue.test.js
File · 0.45
hanoiTowerRecursive
Function · 0.45
Calls
no outgoing calls
Tested by
no test coverage detected