📄 hash.h
字号:
/*------------------------------------------------------------------------------*\
=============================
模块名称: HashChain.h
=============================
[目的]
为了方便Hash表的使用.
[描述]
这个模块实现了Hash表的基础类。它提供了对hash表的基本操作,如删除、
插入、查找等操作。
[用法]
这个模块用法很简单,我想用不着更多的说明. :-)
[依赖性]
无
[修改记录]
日期: 01-10-12
版本: 1.01
作者: Brant Q
备注:
[版权]
2000-2002 115软件工厂 版权所有
\*------------------------------------------------------------------------------*/
#ifndef _HASH_H_
#define _HASH_H_
#define KEYLENGTH 64
class CHashElem
{
public:
~CHashElem(){ }
int Key;
int Val;
CHashElem *pNext;
};
class CHash
{
public:
CHash(int iSlots = 10);
~CHash();
bool QueryValue(const int Key,int & Val);
CHashElem* QueryElem(const int iIndex);
bool Insert(int Key, int Val);
bool Remove(const int Key);
int GetLength();
int GetSlotNum();
protected:
CHashElem **m_pHashSlots;
int m_iNumSlots;
int m_iLength;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -