6 unsigned hash_char2(int tsize)
8 char *str[2] = {"abc", "123"};
13 for(i = 0; i < 2; i++) {
14 keys[i] = malloc(sizeof(HKEY));
15 keys[i]->type = CHARS;
16 keys[i]->val.s = strdup(str[i]);
19 return hash(2, keys, tsize);
22 unsigned hash_int2(int tsize)
24 int num[2] = {19, 11}, i;
28 for(i = 0; i < 2; i++) {
29 keys[i] = malloc(sizeof(HKEY));
31 keys[i]->val.i = num[i];
34 return hash(2, keys, tsize);
37 unsigned hash_char2_int2(int tsize)
39 char *str[2] = {"abc", "123"};
40 int num[2] = {19, 11}, i;
44 for(i = 0; i < 2; i++) {
45 keys[i] = malloc(sizeof(HKEY));
46 keys[i]->type = CHARS;
47 keys[i]->val.s = strdup(str[i]);
49 for(i = 2; i < 4; i++) {
50 keys[i] = malloc(sizeof(HKEY));
52 keys[i]->val.i = num[i];
55 return hash(4, keys, tsize);
62 printf("HASH VALUE: %d\n", hash_char2(tsize));
63 printf("HASH VALUE: %d\n", hash_int2(tsize));
64 printf("HASH VALUE: %d\n", hash_char2_int2(tsize));