Hash Tables: GATE DA Previous Year Questions

Hash Tables · Programming, Data Structures and Algorithms

2 questions · asked in 2 of 3 years (2024–2026)

MCQ 21-mark 2

2024Questions per year2026

Questions 1–2 of 2

Q1GATE 20251 markMCQ−0.33 if wrong
Consider a hash table of size 10 with indices {0,1,…,9}\{0, 1, \dots, 9\}, with the hash function

h(x)=3xmod  10h(x) = 3x \mod 10,

where linear probing is used to handle collisions. The hash table is initially empty and then the following sequence of keys is inserted into the hash table: 1, 4, 5, 6, 14, 15. The indices where the keys 14 and 15 are stored are, respectively:

Q2GATE 20241 markMCQ−0.33 if wrong
Consider performing uniform hashing on an open address hash table with load factor α=nm<1\alpha=\frac{n}{m}<1, where nn elements are stored in the table with mm slots. The expected number of probes in an unsuccessful search is at most 11−α\frac{1}{1-\alpha}.
Inserting an element in this hash table requires at most _________ probes, on average.

Keep practising

Topics in Programming, Data Structures and Algorithms

All DA topics ›