#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

#2220 in Data structures

Download history 15/week @ 2024-02-18 34/week @ 2024-02-25 7/week @ 2024-03-03 14/week @ 2024-03-10 13/week @ 2024-03-17

70 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