subms-treap-0.5.2 has been yanked.
Treap - Rust
Probabilistic balanced BST. Random priorities + heap-on-priority + BST-on-key give expected O(log n) without colour bits or rebalancing factors.
Part of the submillisecond.com cookbook. Zero external dependencies; std only.
Install
[]
= "0.4"
Quickstart
Public API
pub struct Treap<K, V>pub fn new(seed: u64) -> Selfpub fn with_capacity(seed: u64, capacity: usize) -> Selfpub fn len(&self) -> usizepub fn is_empty(&self) -> boolpub fn insert(&mut self, key: K, value: V) -> Option<V>pub fn get(&self, key: &K) -> Option<&V>pub fn remove(&mut self, key: &K) -> Option<V>pub fn collect_in_order(&self) -> Vec<(&K, &V)>
Files
src/lib.rs- implementation.tests/- integration tests; correctness, edge cases, property/stress.examples/demo.rs- stdout walkthrough.examples/perf_main.rs- bench entry (behind theharnessfeature).
License
Dual-licensed under MIT OR Apache-2.0.