Skip to content

parent

parent(index, numLeaves): number

Defined in: packages/core/src/beekem/tree-math.ts:161

Parent of a node, given total number of leaves in the tree.

For non-power-of-2 trees, repeatedly applies parentStep until the result falls within the valid node range.

number

number

number

if the node is the root