What is a simple C library for a set of integer sets?
- by conradlee
I've got to modify a C program and I need to include a set of unsigned integer sets. That is, I have millions of sets of integers (each of these integer sets contains between 3 and 100 integers), and I need to store these in some structure, lets call it the directory, that can in logarithmic time tell me whether a given integer set already exists in the directory. The only operations that need to be defined on the directory is lookup and insert.
This would be easy in languages with built-in support for useful data structures, but I'm a foreigner to C and looking around on Google did (surprisingly) not answer my question satisfactorily. This project looks about right:
http://uthash.sourceforge.net/
but I would need to come up with my own hash key generator.
This is a standard, simple problem, so I hope there is a standard and simple solution.