#set #integer #operations #structures #different #data

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

#2486 in Data structures

Download history 19/week @ 2024-07-21 36/week @ 2024-07-28 10/week @ 2024-08-04 17/week @ 2024-08-11 14/week @ 2024-08-18 15/week @ 2024-08-25 9/week @ 2024-09-01 13/week @ 2024-09-08 10/week @ 2024-09-15 26/week @ 2024-09-22 149/week @ 2024-09-29 65/week @ 2024-10-06 37/week @ 2024-10-13 138/week @ 2024-10-20 99/week @ 2024-10-27 71/week @ 2024-11-03

348 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