该文件是EPANET中HASH.C的头文件,下面列出了该文件的源码以及我的中文注释

/* HASH.H
**
** Header file for Hash Table module HASH.C
**
*/

#define HTMAXSIZE 1999
#define NOTFOUND  0

//哈希表结构,是一个单向链表结构
struct HTentry
{
 char  *key;
 int  data;
 struct HTentry *next;
};

//定义一个指向哈希表的指针
typedef struct HTentry *HTtable;

//接口函数
HTtable *HTcreate(void); //创建一个哈希表,并将该表的首指针返回
int     HTinsert(HTtable *, char *, int);//将一个字符串以及该字符串的索引值插入到哈希表中
int  HTfind(HTtable *, char *);//返回指定字符串在哈希表中的索引值
char    *HTfindKey(HTtable *, char *);
void HTfree(HTtable *);//释放哈希表

相关文章:

  • 2022-01-13
  • 2021-11-23
  • 2021-04-02
  • 2021-06-24
  • 2021-10-03
  • 2021-10-03
  • 2021-10-03
  • 2021-08-30
猜你喜欢
  • 2021-11-23
  • 2021-11-23
  • 2021-10-21
  • 2021-08-07
  • 2021-07-31
  • 2021-10-25
  • 2021-09-05
相关资源
相似解决方案