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)?
- A3
- B4
- C5Correct answer
- D6
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.