Skip to content

Latest commit

 

History

History
41 lines (33 loc) · 2.05 KB

README.md

File metadata and controls

41 lines (33 loc) · 2.05 KB

IntSet IntSet

GitHub last commit

GitHub search hit counter Nuget GitHub code size in bytes

What is it?

It is a specialized data structure for storing a set of integers of type Int32.

Unlike the universal HashSet, numbers are not stored explicitly, but are packed into compact ordered structures. This allows you to save on the used RAM for large set sizes. In the worst case, the structure takes up ~525 MB in memory, while it can contain the full range of Int32 numbers. A hashset with such volumes consumes tens of gigabytes.

The structure implements the standard ISet interface, and can be used in all scenarios instead of HashSet. Also IntSet implements the IEnumerable interface, which enumerate numbers in ascending order without overhead.

How to use?

The structure is designed as a Net Standard 2.1 library that can be used in any compatible projects.

To use it, install the nuget package:

Install-Package IntSet

Usage Example

using Kibnet;
var intSet = new IntSet();
intSet.Add(123);
var isContains = intSet.Contains(123);
intSet.Remove(123);

What is your proof?

The repository has tests that show that everything works as it should.

I also have a code with benchmarks that shows superiority over HashSet in the operations of adding, deleting, and contains. I will publish it in this repository after I bring it to an acceptable form.