码迷,mamicode.com
首页 > 其他好文 > 详细

散列ADT

时间:2018-04-13 11:28:05      阅读:137      评论:0      收藏:0      [点我收藏+]

标签:htable   type   str   code   散列   node   adt   key   ali   

分离链表法解决冲突的散列表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 };

初始化散列表实现:

 

散列ADT

标签:htable   type   str   code   散列   node   adt   key   ali   

原文地址:https://www.cnblogs.com/lwyeah/p/8818006.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!