?? 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 + -