Initial import.
This commit is contained in:
30
hashtbl.h
Normal file
30
hashtbl.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
class HashNode
|
||||
{
|
||||
public:
|
||||
~HashNode();
|
||||
|
||||
char * key;
|
||||
void * content;
|
||||
HashNode * next;
|
||||
};
|
||||
|
||||
class HashTable
|
||||
{
|
||||
public:
|
||||
HashTable(int n_size);
|
||||
~HashTable();
|
||||
void add(char * key, void * content);
|
||||
void * get(char * key);
|
||||
|
||||
private:
|
||||
int size;
|
||||
HashNode ** table;
|
||||
|
||||
HashNode * newHashNode(char * key, void * content, HashNode * next);
|
||||
unsigned int HashString(const char * str);
|
||||
|
||||
HashTable(); // We leave this unimplemented ;)
|
||||
};
|
||||
Reference in New Issue
Block a user