Skip to content
Related Articles
Open in App
Not now

Related Articles

Data Structures | Hash | Question 3

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

The keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?

(A) A
(B) B
(C) C
(D) D

Answer: (C)

Explanation: To get the idea of open addressing concept, you can go through below lines from Wikipedia
Open addressing, or closed hashing, is a method of collision resolution in hash tables. With this method a hash collision is resolved by probing, or searching through alternate locations in the array (the probe sequence) until either the target record is found, or an unused array slot is found, which indicates that there is no such key in the table. Well known probe sequences include:

linear probing in which the interval between probes is fixed–often at 1.
quadratic probing in which the interval between probes increases linearly (hence, the indices are described by a quadratic function).
double hashing in which the interval between probes is fixed for each record but is computed by another hash function.

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!