Cm = m - (N - ( N*((N-1)/N)m) = m - N + N*((N-1)/N)m
An example. Consider the file ShortList.txt which is a text file containing English language words. ShortList.txt contains 36721 unique words. If we hash these words into a hash table containing 73342 slots then N = 73342 and m=36721. Note that N = 2*m. After attempting to insert all of the words into the table we should expect the table to contain approximately N*(1 - ((N-1)/N)m-1) = 28888 words. This implies that the remaining 7833 words are expected to be involved in collisions and stored outside of the hash table. Top of this page
Home page ![]() ![]() |