Two-way hashing with separate chaining and linear probing

  • Authors:
  • Ebrahim Malalla

  • Affiliations:
  • McGill University (Canada)

  • Venue:
  • Two-way hashing with separate chaining and linear probing
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Two-way chaining is a novel hashing scheme that uses two independent truly uniform hash functions f and g to insert m keys into a hash table with n chains, where each key x is inserted into the shortest chain among the chains f(x) and g( x), breaking ties randomly. It is known [13, 18] that the worst-case search time of two-way chaining is log2 log n + m/n + O(1), asymptotically almost surely. In this thesis, we study the two-way chaining paradigm under different assumptions. First, we generalize the result to nonuniform hash functions. We analyze two-way chaining in the fixed density model where the two independent hash functions behave according to two densities defined on the unit interval. When m = Ω(n), we prove that asymptotically almost surely, the worst-case search time is at least log2 log n - O(1). If, in addition, the densities are bounded, then it is at most log2 log n + O( m/n). Secondly, we consider the off-line version of two-way chaining where all the hashing values available for the m keys are known in advance. For constant k ∈ N , we show that there is a threshold ck such that if m ≤ ckn, then one can assign the keys to the chains so that the maximum search time is at most 2k, asymptotically almost surely. We tightly estimate ck, and prove that it is, in fact, asymptotic to k. Algorithms for finding such assignments are also given. Thirdly, we utilize the two-way chaining paradigm to design efficient open addressing hashing schemes. We study two-way linear probing algorithms. These are algorithms that employ two independent linear probe sequences to hash the keys. We prove an Ω(log log n) universal lower bound on the worst-case search time of any two-way linear probing algorithm, where n is the hash table size. We show, however, that some simple two-way linear probing algorithms, unexpectedly, have implausible worst-case performances. Subsequently, we present several efficient two-way linear probing algorithms whose performance matches the lower bound. Simulations back up the theoretical results.