r/C_Programming • u/Significant_Ant9861 • Aug 08 '26
Hash table
I am newbie and a beginner in c language. I would like to learn the hash table for my next semester.
I kindly ask for some help in this matter. I still struggle in the basics even using the ai models.
8
Upvotes
View all comments
Show parent comment
1
u/flatfinger Aug 10 '26
Code to search for an item and add it if it doesn't exist would be something like:
Decreasing
hashTable->live_itemswill remove items from the table without any need to do anything with the contents of the arrays. When a new items is added, it may receive a slot that was associated with a different masked hash value, but that will be detected because the hash value associated with the slot won't be appropriate for the masked hash value.