1 unstable release

0.1.0 Jun 11, 2020

#57 in #set

Download history 6/week @ 2022-03-15 147/week @ 2022-03-22 192/week @ 2022-03-29 73/week @ 2022-04-05 118/week @ 2022-04-12 247/week @ 2022-04-19 109/week @ 2022-04-26 260/week @ 2022-05-03 379/week @ 2022-05-10 511/week @ 2022-05-17 313/week @ 2022-05-24 327/week @ 2022-05-31 461/week @ 2022-06-07 442/week @ 2022-06-14 404/week @ 2022-06-21

1,697 downloads per month

MIT/Apache

58KB
1.5K SLoC

sorted_vector_map

sorted_vector_map is an implementation of an ordered map and set (like std::collections::BTreeMap and std::collections::BTreeSet) using a sorted vector as the backing store.

Sorted vector maps are appropriate when data is frequently loaded from an ordered source, queried a small number of times, and infrequently modified through insertion or removal.

Loading from an ordered sequence is O(n) through an optimization to insert that handles in-order insertions specially. Extension of the sequence is also optimized, where extending a map or set of size n with m elements in a single operation is O(n + m log m). Otherwise, loading from an unordered sequence is O(n^2).

Look-up is O(log n) through binary search. Insertion and removal are both O(n), as are set operations like intersection, union and difference.

sorted_vector_map is part of rust-shed. See the rust-shed repository for more documentation, including the contributing guide.

License

sorted_vector_map is both MIT and Apache License, Version 2.0 licensed, as found in the LICENSE-MIT and LICENSE-APACHE files.

Dependencies

~450KB