MCPcopy
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

instantiateHeapFunction · 0.95
MinHeap.test.jsFile · 0.45
MaxHeap.test.jsFile · 0.45

Calls 2

heapifyUpMethod · 0.95
pushMethod · 0.80

Tested by 1

instantiateHeapFunction · 0.76