#tree #root #treemath

treemath

Arithmetics for perfect binary trees

2 releases

Uses new Rust 2024

new 0.1.1 Apr 26, 2025
0.1.0 Apr 24, 2025

#34 in #root

Download history 80/week @ 2025-04-19

80 downloads per month

Apache-2.0

21KB
514 lines

treemath

Arithmetics for perfect binary trees. I repeat, ONLY for perfect binary trees with a flat in-order representation, otherwise it simply does not work. Perfect binary trees are a subcategory of binary trees where each node has two children and all leaves are on the same level.

This crates tries to be as fast as optimal, going branchless wherever possible and using some bit twiddling techniques.

See benchmarks for an overview of the benefits over a naive implementation.

No runtime deps