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

Function getChildrenPositions

Data-Structures/Heap/KeyPriorityQueue.js:23–23  ·  view source on GitHub ↗
(position)

Source from the content-addressed store, hash-verified

21// Priority Queue Helper functions
22const getParentPosition = (position) => Math.floor((position - 1) / 2)
23const getChildrenPositions = (position) => [2 * position + 1, 2 * position + 2]
24
25class KeyPriorityQueue {
26 // Priority Queue class using Minimum Binary Heap

Callers 2

updateMethod · 0.85
_shiftDownMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected