Skip to content

sparse sets in C. (Hashtable uses open addressing w/ quadratic probing)

Notifications You must be signed in to change notification settings

pakeke-constructor/sets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bugs:

  • heap corruption somewhere (use Dr Memory or valgrind)
  • Need to add a tombstone bucket upon hashtable removal (Else chaining gets messed up when an item is removed.)

TODO:

  • Maybe reduce grow threshold
  • check for mem leaks
  • add a hash collision counter

sparse sets in c

This is my sparse set implementation. It's heavily untested and may have memory leaks and bugs.

however, it should have (amortized) O(1) removal, addition, as well as a nice iteration macro. The hasher uses quadratic probing, and allocates 4n space for every n pointers added to the data structure (may change it to 3n in the future, 4 times could be a bit overkill.)

Also, sets will automatically reallocate their own space in an efficient manner

About

sparse sets in C. (Hashtable uses open addressing w/ quadratic probing)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published