Age | Commit message (Collapse) | Author | Files | Lines |
|
The foreach function iterates over all of the elements and calls a
function which is guaranteed to make no modification to the table,
hence the whole loop never changes the hashtable.
This makes it possible to nest two loops over the same hashtable
without manual casting.
|
|
Add functions to efficiently sort lists and to merge sorted lists.
The sort function is a bottom-up mergesort (guaranteed O(n lg n)).
|
|
Fix some typos and copy/paste errors.
|
|
Make threshold computation consistent with the comment.
Fixes wrong behavior when num_slots < 8 (which resulted in 0 free
slots).
|
|
Removed elements should not terminate the lookup routine, but they
should never be used for comparison, because the equality function can
legitimately assume that both its arguments are valid.
|
|
The i variable is never used and (as expected) compilers warn about
this.
Fixed by removing the variable declaration.
|
|
Add implementation of open-addressing hashtable (collisions are
resolved with linear probing by means of double hashing).
|
|
Add simple implementation of doubly-linked list.
|
|
|