3 releases

0.1.2 Jan 5, 2025
0.1.1 Nov 28, 2024
0.1.0 Nov 27, 2024

#1668 in Algorithms

Download history 250/week @ 2024-11-23 41/week @ 2024-11-30 3/week @ 2024-12-28 152/week @ 2025-01-04 6/week @ 2025-01-11

161 downloads per month

MIT license

36KB
678 lines

ksq - k-2 tree library for rust

ksq is an implementation of a K2 tree (k²-tree), which, when storing sparse bits, is a very space-effective matrix. This library implements the tree as a flat 1-d array, rather than explicitly encoding dimensionality.

Unlike some other k2 trees, I've opted to use a u16, not a u8. This means that the tree will grow by N<<4 each layer -- and each cell can represent a maximum of 16 other cells, not 8. This may change in the future.


lib.rs:

ksq is an implementation of a K2 tree (k²-tree), which, when storing sparse bits, is a very space-effective matrix. This library implements the tree as a flat 1-d array, rather than explicitly encoding dimensionality.

Unlike some other k2 trees, I've opted to use a u16, not a u8. This means that the tree will grow by N<<4 each layer -- and each cell can represent a maximum of 16 other cells, not 8.

No runtime deps