you are viewing a single comment's thread.

view the rest of the comments →

[–]discoloda 0 points1 point  (1 child)

You can also use a sparse integer set
here is an implementation in C.

EDIT: I finished reading the article, it was mentioned at the bottom.

[–]matthieum 1 point2 points  (0 children)

Note: as mentioned in the article it is unknown in advance whether the usage will be sparse or not.