thx, this is exactly what i needed! But how can i know when is the best time to start replacing entries from the table? regardless of the replacement scheme i use, how should i technically remove old entries from the table? should i iterate over the whole array and start deleting items?
EDIT: I was getting out of memory errors! so now my implementation includes one array in size 500009, each index contains a LinkedList (for chaining when collision occurs)
so right now when a linked list has over 2 items in it i just clear them from the list. but i don't know if my approach is good or not.