Add Binary heap structure (#5084)
Co-authored-by: Ernesto García <ernestognw@gmail.com> Co-authored-by: cairo <cairoeth@protonmail.com>
This commit is contained in:
13
scripts/generate/templates/Heap.opts.js
Normal file
13
scripts/generate/templates/Heap.opts.js
Normal file
@ -0,0 +1,13 @@
|
||||
const makeType = (valueSize, indexSize) => ({
|
||||
struct: `Uint${valueSize}Heap`,
|
||||
node: `Uint${valueSize}HeapNode`,
|
||||
valueSize,
|
||||
valueType: `uint${valueSize}`,
|
||||
indexSize,
|
||||
indexType: `uint${indexSize}`,
|
||||
blockSize: Math.ceil((valueSize + 2 * indexSize) / 256),
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
TYPES: [makeType(256, 64), makeType(208, 24)],
|
||||
};
|
||||
Reference in New Issue
Block a user