PDA

View Full Version : integer hashing


justinhull
03-15-2005, 12:59 AM
Alrighty I've got an array of 19 for the hash table and i'm hashing integers using mod 19. I'm using linear probing but I can't get it to loop back around to zero if the end of the table is full. If anyone could point me in the right direction I would be greatful. thanks

Unit
03-15-2005, 08:55 PM
When you probe for the next available empty location, use the mod operator.

for example you would use (currenthash + 1) % 19 to figure out the next location.