// random.c #include #include #include int hash(int key, int size) { /* Intializes random number generator seed */ //time_t t; //srand((unsigned) time(&t)); srand((unsigned) key); int result = (key * rand()) % size; return (result < 0) ? -result : result; } int main(){ int size = 16; int array[16] = { 0 }; for (int i=0; i < size; i++) { int h = hash(i,size); printf("%i: %d\n", i, h); array[h]++; } for (int i=0; i