1 // SPDX-License-Identifier: MIT
3 // sset.c - an all O(1) implementation of sparse sets as presented in:
4 // "An Efficient Representation for Sparse Sets"
5 // by Preston Briggs and Linda Torczon
7 // Copyright (C) 2017 - Luc Van Oostenryck
14 struct sset
*sset_init(unsigned int first
, unsigned int last
)
16 unsigned int size
= last
- first
+ 1;
17 struct sset
*s
= malloc(sizeof(*s
) + size
* 2 * sizeof(s
->sets
[0]));
25 void sset_free(struct sset
*s
)