updated hash methods. just increasing the size of the hash helps a lot with loading larger networks. perhaps hash could be extended to dynamically size based on network size.

This commit is contained in:
Sam Hatchett
2014-01-31 11:16:07 -05:00
parent 93036690a0
commit caa794447c
6 changed files with 126 additions and 116 deletions

View File

@@ -7,22 +7,22 @@
#ifndef HASH_H
#define HASH_H
#define HTMAXSIZE 1999
#define ENHASHTABLEMAXSIZE 128000
#define NOTFOUND 0
struct HTentry
typedef struct HTentryStruct
{
char *key;
int data;
struct HTentry *next;
};
struct HTentryStruct *next;
} ENHashEntry;
typedef struct HTentry *HTtable;
typedef ENHashEntry *ENHashTable;
HTtable *HTcreate(void);
int HTinsert(HTtable *, char *, int);
int HTfind(HTtable *, char *);
char *HTfindKey(HTtable *, char *);
void HTfree(HTtable *);
ENHashTable *ENHashTableCreate(void);
int ENHashTableInsert(ENHashTable *, char *, int);
int ENHashTableFind(ENHashTable *, char *);
char *ENHashTableFindKey(ENHashTable *, char *);
void ENHashTableFree(ENHashTable *);
#endif