From 345ed8eb6ea31f85aace9824ddf07762410074e7 Mon Sep 17 00:00:00 2001 From: Hongcheng Date: Tue, 3 Oct 2023 23:02:05 +0800 Subject: [PATCH] ADD file via upload --- test_hash.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test_hash.h diff --git a/test_hash.h b/test_hash.h new file mode 100644 index 000000000..84ee26129 --- /dev/null +++ b/test_hash.h @@ -0,0 +1,37 @@ + +/** +* @file: test_hash.h +* @brief: a application of test hash function +* @version: 3.0 +* @author: Yao wenying +* @date: 2023/05/26 +*/ + + +#ifndef __HASHMAP_H__ +#define __HASHMAP_H__ + +#include +#include +#include + + +//结点结构体 +typedef struct LNode +{ + int data;//存储值 + struct LNode *next; +}LNode,*Linklist; + +//构建哈希表结构体 +typedef struct HashTable +{ + Linklist list; + int count;//记录该结点下共发生冲突结点个数 +}HashTable; + +int Hash(int key); +void InitHashTable (HashTable *h); +void InsertKey(HashTable *h,int key,int i); +LNode *Search(HashTable h,int key); +void show(HashTable h); \ No newline at end of file