Skip to content

ISRO Scientist/Engineer CSE 2016Algorithms › Hashing

ISRO Scientist/Engineer CSE 2016 PYQ: A Hash Function $f$ defined as $f(key)= key \mod 7$. With linear probing while inserting the keys…

A Hash Function $f$ defined as $f(key)= key \mod 7$. With linear probing while inserting the keys 37,38,72,48,98,11,56 into a table indexed from 0, in which location key 11 will be stored (Count table index 0 as $0^{th}$ location)?

  1. A
    3
  2. B
    4
  3. C
    5
    Correct answer
  4. D
    6

Answer

(C) 5

Approach

Apply the hash function $f(key) = key \bmod 7$ to each key in the given insertion order, resolving collisions using linear probing (check the next index cyclically). Track the table state after each insertion to determine the final position of key 11.

Reviewed by ISRO IQ Editorial Team.