A ten-slot hash table uses h(k)=k mod 10 and linear probing. Its occupied slots are 2:42, 3:23, 4:34, 5:52, 6:46, 7:33; all others are empty. How many different insertion orders produce this table?
For 52 to land in five, 42,23,34 must all precede it. For 33 to reach seven, those three plus 52 and 46 must already be present, so 33 is last. Among the 5! orders of the first five keys, 52 must be last relative to {42,23,34,52}, which happens in one quarter. Therefore 120/4=30, C.
More Searching, Sorting and Hashing questions
GATE 2015 CS (CS2) Q50– Which integer hash function distributes keys i=0,…,2020 most uniformly over buckets 0,…,9?
GATE 2015 CS (CS3) Q22– A hash table with 25 slots stores 2000 elements. Find its load factor α.
GATE 2021 CS (CS2) Q18– Find the worst-case number of arithmetic operations in recursive binary search on a sorted…
GATE 2026 CS (CS1) Q24– Consider a hash table P[0, 1, , 10] that is initially empty. The hash table is maintained…
GATE 2026 CS (CS2) Q30– The keys 5, 28, 19, 15, 26, 33, 12, 17, and 10 are inserted into a hash table using the…
GATE 2025 CS (CS1) Q33– The pseudocode of a function fun() is given below: Let A[0,...,29] be an array storing 30…