#set #integer #operations #structures #different #time

intset

Various integer set data structures, each efficient for different operations

1 stable release

1.0.2 Oct 1, 2021
1.0.1 Sep 9, 2021

#2506 in Data structures

Download history 14/week @ 2024-05-20 3/week @ 2024-05-27 7/week @ 2024-06-03 8/week @ 2024-06-10 8/week @ 2024-06-17 8/week @ 2024-06-24 1/week @ 2024-07-01 24/week @ 2024-07-08 23/week @ 2024-07-15 17/week @ 2024-07-22 41/week @ 2024-07-29 6/week @ 2024-08-05 17/week @ 2024-08-12

83 downloads per month
Used in dpc

Apache-2.0

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.

No runtime deps