Open In App

Data Structures | Hash | Question 3

Last Updated : 28 Jun, 2021
Like 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?










Answer: (C)


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
Please comment below if you find anything wrong in the above post

Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads