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. Which insertion order could produce this table?
In C, 46 occupies six, 34 occupies four, 42 occupies two, and 23 occupies three. Then 52 probes occupied two,three,four and takes five. Finally 33 probes three through six and takes seven. The other orders place either 52 or 33 in a different earlier empty slot. Thus C.
More Searching, Sorting and Hashing questions
GATE 2010 CS (CS1) Q63– A ten-slot hash table uses h(k)=k mod 10 and linear probing. Its occupied slots are 2:42,…
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…