MCPcopy 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.jsFile · 0.45
MaxHeap.test.jsFile · 0.45
hanoiTowerRecursiveFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected