以字符串为key的哈希表的实现
前言 由于工作的需要,我需要使用C语言来写一个哈希结构,其中哈希算法使用目前最通用也是效率较高的time33算法,并利用拉链法来解决冲突。 源码 #include "HashTable.h" #include <stdlib.h> #include <string.h> #include <stdio.h> #define TABLE_SIZE (10241024) / element of the hash table's chain list / struct kv { struct kv next; char* key; void* value; void(free_value)(void); }; /* HashTable / struct HashTable { struct kv ** table; }; / constructor of struct kv / static void init_kv(struct kv kv) { kv->next = NULL; kv->key =....