You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#pragma once
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "rbtree.h"
|
|
|
|
|
#define BUCKETCOUNT 9000
|
|
|
|
|
struct _hash_Entry
|
|
|
|
|
{
|
|
|
|
|
const char* key;//<2F><>
|
|
|
|
|
RBRoot* value;//ֵ
|
|
|
|
|
struct _hash_Entry* next;//<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
};//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
typedef struct _hash_Entry entry;
|
|
|
|
|
typedef struct _Table
|
|
|
|
|
{
|
|
|
|
|
entry bucket[BUCKETCOUNT]; //<2F><><EFBFBD><EFBFBD>Ͱ
|
|
|
|
|
}hashTable;
|
|
|
|
|
char* strDup(const char* str);
|
|
|
|
|
unsigned int hashfunc(char*key, int len);//<2F><>ϣֵ<CFA3>ļ<EFBFBD><C4BC><EFBFBD>
|
|
|
|
|
void initHashTable(hashTable* t);//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ϣ<EFBFBD><CFA3>
|
|
|
|
|
void freeHashTable(hashTable* t);//<2F>ͷŹ<CDB7>ϣ<EFBFBD><CFA3>
|
|
|
|
|
int insertEntry(hashTable* t, char *key, RBRoot *value);//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
RBRoot* findValue(hashTable*t, char *key);//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
//entry* removeTable(hashTable*t, char key);//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|