free(old_buckets); To make the dictionary work with any data type, replace int value with void *value and store the size or use a union. 6.3 Thread Safety For multithreaded programs, add mutex locks per bucket (fine-grained locking) or a single global lock (coarse-grained but simpler):
printf("=== Dictionary Implementation using Hashing in C ===\n\n"); c program to implement dictionary using hashing algorithms
Deleting 'orange'... 'orange' deleted successfully. === Dictionary Contents (Total: 3 entries) === Bucket[4412]: (grape -> 40) Bucket[9234]: (apple -> 99) Bucket[9876]: (banana -> 20) Total number of key-value pairs: 3 6.1 Dynamic Resizing (Rehashing) A static hash table becomes inefficient when it fills up. The load factor α = count / size should ideally stay below 0.75. Implement rehashing: free(old_buckets); To make the dictionary work with any