#bst #stable #treemap #troll #dictionary #trolls #map

stable_bst

An ordered map and set based on a binary search tree. Works with stable Rust 1.9.0.

4 releases (2 breaking)

Uses old Rust 2015

0.2.0 Aug 19, 2016
0.1.0 Jul 9, 2016
0.0.2 Jul 7, 2016
0.0.1 Jul 7, 2016

#1683 in Data structures

Download history 1175/week @ 2023-11-06 1357/week @ 2023-11-13 869/week @ 2023-11-20 1378/week @ 2023-11-27 1496/week @ 2023-12-04 1063/week @ 2023-12-11 619/week @ 2023-12-18 187/week @ 2023-12-25 636/week @ 2024-01-01 1674/week @ 2024-01-08 4027/week @ 2024-01-15 4050/week @ 2024-01-22 5220/week @ 2024-01-29 6053/week @ 2024-02-05 6331/week @ 2024-02-12 7520/week @ 2024-02-19

25,143 downloads per month
Used in 4 crates (via rustfst)

MIT/Apache

270KB
2.5K SLoC

An ordered map and set based on a binary search tree.

Forked from https://github.com/contain-rs/bst and updated to work with stable Rust (1.9.0).

Documentation here; crate here.


lib.rs:

Maps are collections of unique keys with corresponding values, and sets are just unique keys without a corresponding value.

This crate defines the TreeMap and TreeSet types. Their keys must implement Ord.

TreeMaps are ordered.

Examples

use stable_bst::TreeSet;

let mut tree_set = TreeSet::new();

tree_set.insert(2);
tree_set.insert(1);
tree_set.insert(3);

for i in tree_set.iter() {
   println!("{}", i) // prints 1, then 2, then 3
}

Dependencies