#include <stdio.h>
#include "hash.h"

int main(int argc, char ** argv)
{
	hashtable h;
	int i;

	hash_init (&h);

	hash_insert(&h, 1, 5);
	hash_insert(&h, 2, 6);
	hash_insert(&h, 3, 7);
	hash_insert(&h, 4, 8);

	for (i = 5; i < 40; i++)
		hash_insert(&h, i, i+10);

	for (i = 1; i < 40; i++)
		printf("Key is %d and val is %d\n", i, hash_fetch(&h,i));

	hash_insert(&h, 3, 19);
	hash_insert(&h, 4, 20);
	
	printf("\nAfter mod\n");
	for (i = 1; i < 40; i++)
		printf("Key is %d and val is %d\n", i, hash_fetch(&h,i));

	hash_deleteEntry(&h, 1);
	hash_deleteEntry(&h, 39);
	printf("\nAfter mod2\n");
	for (i = 1; i < 40; i++)
		printf("Key is %d and val is %d\n", i, hash_fetch(&h,i));

	for (i = 1; i < 80; i++)
		hash_insert(&h, i, i+20);

	printf("\nAfter mod3\n");
	for (i = 1; i < 80; i++)
		printf("Key is %d and val is %d\n", i, hash_fetch(&h,i));

	return 0;
}
