In real applications it is often the case that the hash


Question: In real applications, it is often the case that the hash table size is not fixed in advance, since you don't know, in advance, how many items you will insert. The most common heuristic for dealing with this is to start k, the hash table size, at some reasonably small value, and then when n, the number of items, gets to be greater than 2k, you double the hash table size. In this exercise we propose a different idea. Suppose you waited until every single slot in the hash table had at least one item in it, and then you increased the table size. What is the expected number of items that will be in the table when you increase the size? In other words, how many items do you expect to insert into a hash table in order to ensure that every slot has at least one item?

(Hint: Let Xi be the number of items added between the time that there are i - 1 occupied slots for the first time and the first time that there are i occupied slots.)

Solution Preview :

Prepared by a verified Expert
Mathematics: In real applications it is often the case that the hash
Reference No:- TGS02374329

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)