@ARTICLE{Knuth97linearprobing, author = {Donald E. Knuth}, title = {Linear Probing and Graphs}, journal = {Algorithmica}, year = {1997}, volume = {22}, pages = {561--568} }

Share

OpenURL

Abstract

. Mallows and Riordan showed in 1968 that labeled trees with a small number of inversions are related to labeled graphs that are connected and sparse. Wright enumerated sparse connected graphs in 1977, and Kreweras related the inversions of trees to the so-called "parking problem" in 1980. A combination of these three results leads to a surprisingly simple analysis of the behavior of hashing by linear probing, including higher moments of the cost of successful search. The well-known algorithm of linear probing for n items in m ? n cells can be described as follows: Begin with all cells (0; 1; : : : ; m \Gamma 1) empty; then for 1 k n, insert the kth item into the first nonempty cell in the sequence h k ; (h k + 1) mod m; (h k + 2) mod m; : : : , where h k is a random integer in the range 0 h k ! m. (See, for example, [4, Algorithm 6.4L].) The purpose of this note is to exhibit a surprisingly simple solution to a problem that appears in a recent book by Sedgewick and Flajolet [9]: E...