You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Add Binary Search Tree (BST) Support to Heapless #608
The heapless crate currently lacks a Binary Search Tree (BST) implementation. BSTs are essential for use cases like implementing process schedulers with priorities in kernel environments, where efficient ordered data structures are critical without relying on heap allocation.
In particular, I have to remove the use of floating point due to the lack of FPU, or the missing guarantee for it, so instead I have to use fixed point arithmetic to do alpha/rebalancing factor calculation. Sadly, I also needed to calculate logarithm outlined in the paper, so I had to use bisection to find the binary power and approximate the logarithm, which makes it not O(1). Still, it works pretty well and fast in general, but I guess we could further eliminate the fixed crate by reinterpreting the algorithm to see if we can avoid the use of fractions at all.
Compatibility with heapless's existing APIs and no-std guarantees would be ideal.
Would the maintainers consider this addition? I'm happy to contribute or provide more details.
Activity