MCPcopy Create free account
hub / github.com/Reaper622/DataStructure-Algorithm-TS / add

Method add

DataStructure/Heap/Heap.ts:46–62  ·  view source on GitHub ↗

* 堆属于优先队列,只能从末尾添加 * 添加后有可能破坏堆的结构,需要从下到上进行调整 * 如果元素小于父元素,向上置换 *

(item: number)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

Heap.test.jsFile · 0.45

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected