Hashing: GATE CS Previous Year Questions

Hashing · Data Structures

19 questions · asked in 14 of 27 years (2000–2026)

MCQ 13 · MSQ 2 · NAT 41-mark 10 · 2-mark 9

2000Questions per year2026

Questions 16–19 of 19

Q16GATE 20071 markMCQ−0.33 if wrong
Consider a hash function that distributes keys uniformly. The hash table size is 20. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed 0.5.

Q17GATE 20071 markMCQ−0.33 if wrong
Consider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Note that '-' denotes an empty location in the table.

Q18GATE 20051 markMCQ−0.33 if wrong
A hash table contains 10 buckets and uses linear probing to resolve collisions. The key values are integers and the hash function used is key % 10. If the values 43, 165, 62, 123, 142 are inserted in the table, in what location would the key value 142 be inserted?

Q19GATE 20041 markMCQ−0.33 if wrong
Given the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements are true?
i) 9679, 1989, 4199 hash to the same value
ii) 1471, 6171 has to the same value
iii) All elements hash to the same value
iv) Each element hashes to a different value

Keep practising

Topics in Data Structures

All CS topics ›