Thank you all for the usefull comments. Zub , I afraid that binary search will be a little on the slow side (although the idea itself is nice) , I think I prefer using chaining search..but maybe I am wrong here
Unfortunately , I am still a little bit confused.
I got my hash table to work fine, although Not in perfect hashing..but I'm working on it.
I am declaring and defining the array as global (above main() ) in size of 900000 + . It is array of pointers to struct (all set to null at first) . And each of these node structs contains an array of int values.
Because I don't know the exact size of this array (the ints array..not the actual table) in advance (each one is different size) it is a pointer to int and not fixed sized.
I allocate memory for it during the table initialization function.
So if the table array is fixed sized and allocated wherever global variables are allocated (and i still don't know where it is exactly) but it's content is allocated by me on the heap... what does this means??
And second thing:
What if I want to allocate all those structs on the stack instead.. how can I do this ? Rememer that I dont know the exact size in advance..that's why I use malloc.
(I can set the content of the structs to be fixed size but I don't want to waste space for nothing)
I would appreciate if you guys can help me figuring this out.
Thx again.