1,996 views
5 votes
5 votes

The number of different insertion sequences on numbers {1, 14, 26, 44, 60, 71} on an initially empty hash table H of size 6 and a hash function x%6 with linear probing scheme for collision resolution such that the end hash table should look like 60, 1, 14, 26, 44, 71 (The indices of numbers from left to right are 0 to 5) are ________

1 Answer

Best answer
7 votes
7 votes
14, 26 and 44 mod 6 = 2 and hence in any input sequence they must come in sequence (otherwise their sequence changes in the end result). The other 3 numbers hash to distinct locations and hence they can be inserted in any order. So, number of possible insertion sequence

$=\frac{\text{Total insertion sequences}}{\text{Invalid insertion sequences}}$

$=\frac{6!}{3!}$

$= \frac{720}{6} = 120$
edited by

Related questions

0 votes
0 votes
1 answer
3
tishhaagrawal asked Dec 16, 2023
360 views
Below is my approach to solving this question, can anyone please explain if I am doing it the right way?Let X = #free slotssince, m =7 and n = 3So, $4 \leqslant x\leqsla...
73 votes
73 votes
10 answers
4
go_editor asked Apr 21, 2016
27,319 views
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: \mod \: 10$, and linear probing. After inserting $6$ values into an empty hash table, the...