The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Slot-size bound for chaining
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 Qkthat exactly k keys hash to a particular slot is
given by
b. Let Pkbe the probability that M = k, that is, the probability that the slot containing the most keys contains k keys. Show that Pk≤ nQk.
c. Use Stirling’s approximation, equation (3.18), to show that Qk< ek/kk.
![]()
Equation 3.18
d. Show that there exists a constant c > 1 such that Qk0< 1/n3for k0= c lg n/ lg lg n. Conclude that Pk< 1/n2for k ≥k0= c lg n/ lg lg n.
e. Argue that
![]()
Conclude that E [M] = O(lg n/ lg lg n).
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------