MCPcopy Index your code
hub / github.com/TheAlgorithms/JavaScript / peek

Method peek

Data-Structures/Heap/BinaryHeap.js:101–103  ·  view source on GitHub ↗

* Retrieves the top element of the heap without removing it. * @returns {*} - The top element of the heap.

()

Source from the content-addressed store, hash-verified

99 * @returns {*} - The top element of the heap.
100 */
101 peek() {
102 return this.heap[0]
103 }
104
105 /**
106 * Removes and returns the top element of the heap.

Callers 2

extractTopMethod · 0.95
BinaryHeap.test.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected