Describe one simple rehashing policy.

The simplest rehashing policy is linear probing. Suppose a key K hashes to location i. Suppose other key occupies H[i]. The following function is used to generate alternative locations:
rehash(j) = (j + 1) mod h
where j is the location most recently probed. Initially j = i, the hash code for K. Notice that this version of rehash does not depend on K.

Author: on September 3, 2010
Category: C++ Interview Questions
  • Recently in C++ Interview Questions:

  • Recent questions

    Copy Protected by Send free sms - Love2sms.