Question: Suppose that we have a hash table with n slots, with collisions resolved by chaining, and suppose that n keys are inserted into the table.

Suppose that we have a hash table with n slots, with collisions resolved by chaining, and suppose that n keys are inserted into the table. Each key is equally likely to be hashed to each slot. Let M be the maximum number of keys in any slot after all the keys have been inserted. Your mission is to prove an O (lg n/lg lg n) upper bound on E[M], the expected value of M.
a. Argue that the probability Qk that exactly k keys hash to a particular slot is given by Qk = (1/n)k(1 €“ 1/n) n€“k (n/k)..
b. Let Pk be the probability that M = k, that is, the probability that the slot containing the most keys contains k keys. Show that Pk ≤ n Q k..
c. Use Stirling's approximation, equation (3.17), to show that Qk d. Show that there exists a constant c > 1 such that for k0 = clg n/ lg lg n. Conclude that Pk e. Argue that

c lgn n+ Pr Ms Ig lg n clgn clgn E[M]< Pr{M lg lg n Ig lgn

Conclude that E[M] = O(lg n/ lg lg n)..

c lgn n+ Pr Ms Ig lg n clgn clgn E[M] < Pr{M lg lg n Ig lgn

Step by Step Solution

3.45 Rating (158 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a A particular key is hashed to a particular slot with probabi... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

C-S-A (95).docx

120 KBs Word File

Students Have Also Explored These Related Algorithms Questions!