分离链表法解决冲突的散列表ADT实现
数据结构定义如下:
1 struct ListNode; 2 typedef struct ListNode *Position; 3 struct HashTbl; 4 typedef struct HashTbl *HashTable; 5 6 HashTable InitializeTable(int TableSize); 7 void DestroyTable(HashTable H); 8 Position Find(ElementType Key, HashTable H); 9 void Insert(ElementType Key, HashTable H); 10 11 struct ListNode{ 12 ElementType Element; 13 Position Next; 14 }; 15 16 typedef Position List; 17 18 struct HashTbl{ 19 int TableSize; 20 List *TheLists; 21 };
初始化散列表实现:
原文地址:https://www.cnblogs.com/lwyeah/p/8818006.html
时间: 2024-11-14 13:10:21