Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Data Structures
  • Hashing
  • Easy

A hash table of size 77 uses h(k)=k mod 7h(k) = k \bmod 7 with linear probing. The keys 1515, 2222 and 88 are inserted in this order into an empty table. In which slot is 88 stored?

Linear Structures

Pick an option to check your answer.

  1. 15 mod 7=115 \bmod 7 = 1 → slot 11.
  2. 22 mod 7=122 \bmod 7 = 1 → collision; probe slot 22 → stored at 22.
  3. 8 mod 7=18 \bmod 7 = 1 → slots 11 and 22 are full; probe slot 33 → stored at 33.

Why not the others

  • 11 is the home slot, already taken by 1515.
  • 22 is taken by 2222.
  • 44 skips the free slot 33; linear probing takes the first free slot.

Report an error

GATE CS · Data Structures · Linear Structures