ADD file via upload
This commit is contained in:
parent
f92554b0f4
commit
345ed8eb6e
|
@ -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<stdlib.h>
|
||||||
|
#include<string.h>
|
||||||
|
#include<stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
//结点结构体
|
||||||
|
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);
|
Loading…
Reference in New Issue