顺序哈希表
头文件
![]()
1 //@ author 成鹏致远
2 //@ net http://infodown.tap.cn
3 //@ qq 552158509
4 //@ blog lcw.cnblogs.com
5
6 #ifndef __HASHSQ_H
7 #define __HASHSQ_H
8
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <stdbool.h>
12 #include <math.h>
13
14 typedef struct hash_tbl
15 {
16 int len;//哈希表长度
17 int *parray;//指向表的首地址
18 }*p_hash_tbl;
19
20 extern void hash_init(p_hash_tbl *p_hash, int len);//初始化哈希表
21 extern int hash(p_hash_tbl phash, int key);//哈希函数,返回哈希地址
22 extern void hash_insert(p_hash_tbl phash, int key);//插入key值
23 extern void hash_show(p_hash_tbl phash, int hash_val, int key);
24
25
26
27 #endif
View Code