Does anybody know of a Hash Chaining algorithm or a web page for it?
I am trying to implement a hash table with searching and insertion.
Many thanks
Does anybody know of a Hash Chaining algorithm or a web page for it?
I am trying to implement a hash table with searching and insertion.
Many thanks
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Here's one.
First of all, each element of the hash array is actually a linked list. If hasharray[index] != EmptyList, then call List_add (or inser or whatever) to that list. When searching, just do a search on the list if it's not null, if it is then the search return false.