[출처 : http://inthechaos.tistory.com/entry/해시-HashMainc]
#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include "Hash.h"
void main(void)
{
const char *words[] =
{
"naver", "page", "web", "net", "black", "hand",
"rain", "meal", "hi", "wow", "news", "movie",
"car", "sky", "snow", "paper", "task", "air",
"book", "2008", "red", "sound", "voice", "face",
"mob", "girl", "miss", "hope", "sea", "apple",
"man", "think", "smile", "hat", "door", "water",
"claim", "venus", "music", "stop", "green", "gas",
"wind", "house", "right", "no", "sorry", "mine",
"tv", "cry", "boys", "scope", "dress", "star",
"farm", "ever", "play", "piano", "gag", "child",
};
int i, code;
char key[WORD_SIZE];
init();
for(i=0; i<60; i++)
{
printf("%5s ", words[i]);
insertKey(words[i]);
if(i%10 == 9)
{
printf("\n");
}
}
printf("\n");
printHash();
while(1)
{
printf("delete key : ");
scanf("%s", key);
printf("code : %d\n", code = getHashCode(key));
printBucket(code);
if(deleteKey(key) == 0)
{
break;
}
printBucket(code);
printf("\n");
}
}