1 stable release
1.0.2 | Oct 1, 2021 |
---|---|
1.0.1 |
|
#2506 in Data structures
83 downloads per month
Used in dpc
17KB
284 lines
intset
Various integer sets in Rust, tuned to be fast for certain operations.
GrowSet
GrowSet
is a simple set of integers.
It supports O(1)
addition, clearing, and membership testing,
and O(n)
iteration.
ShrinkSet
ShrinkSet
is a simple set of integers.
It supports O(1)
removal, refilling, and membership testing,
and O(n)
iteration.
lib.rs
:
This crate provides a collection of data structures for storing sets of integers. The different data structures are designed to make different operations efficient.
All of the data structures in this crate support the following operations with the associated complexity:
- contains - check if an integer is in the set in O(1) time
- iterate - iterate over the members of the set in O(n) time, where n is the number of elements in the set
- len - return the number of elements in the set in O(1) time
Individual set data structures support additional operations, as documented below.
All of the set data structures in this crate have a maximum capacity, specified as the largest integer that can be stored in the set plus one. Once a set is created, it does no further allocations.