UNPKG

@jawis/shared-page-heap

Version:
35 lines (34 loc) 1.2 kB
/** * Get the left subnode. * * - Returns false when there's no left subnode. * * notes * - It's possible to determine the jump length from the node index. * - The left subtree is always full, so it only depends on the jumplength. * */ export declare const _leftNode: (nodeIndex: number) => number | undefined; /** * Get the right subnode. * * - Returns null when there's no left subnode. * - The JumpLength paremeter is only for double checking. * * * notes * - It's possible to determine the size of the right subtree. * - If it's full it's simple to determine the right subnode. But if it's partial full * the right subnode depends of the size of the right subtree. * - The right subtree is full if the there is enough nodes in the data structure to fill * it up. That's why the size of the data structure is enough to determine its size. */ export declare const _rightNode: (nodeIndex: number, nodeCount: number) => number | undefined; /** * */ export declare const _getRoot: (nodeCount: number) => number; /** * Get jump length of the given node. Assuming the subtree is full. */ export declare const _getJumpLength: (nodeIndex: number) => number;