2 unstable releases

new 0.2.0 May 7, 2024
0.1.0 Jun 11, 2020

#225 in Data structures

Download history 7588/week @ 2024-01-18 5640/week @ 2024-01-25 5710/week @ 2024-02-01 6864/week @ 2024-02-08 5641/week @ 2024-02-15 6101/week @ 2024-02-22 6893/week @ 2024-02-29 6733/week @ 2024-03-07 8345/week @ 2024-03-14 8329/week @ 2024-03-21 6619/week @ 2024-03-28 6695/week @ 2024-04-04 6947/week @ 2024-04-11 7032/week @ 2024-04-18 5491/week @ 2024-04-25 4147/week @ 2024-05-02

24,576 downloads per month
Used in 12 crates (5 directly)

MIT/Apache

75KB
2K 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

~1MB
~19K SLoC