recategorized by
1,016 views
2 votes
2 votes

Consider the hash table of size 12 that uses open addressing with linear probing. Let h(k) = k mod12 be the
hash function used. A sequence of records with keys 43, 63, 84, 11, 5, 72, 15, 16 is in stored into an initially
empty hash table, the bins of which are indexed from zero to 11.
The number of comparision for last element inserted is _________.

what would the answer be 2 or 3

recategorized by

1 Answer

0 votes
0 votes

 When 16 is referred, it is mapped to index 4 at hash table,but 15 is there, so goes to next index, 5 is there, goes to next location..empty space.. so 2 collisions.

0 84
1 72
2 63
3 15
4 5
5 16
6 43
7  
8  
9  
10  
11 11

Related questions

0 votes
0 votes
1 answer
1
tishhaagrawal asked Dec 16, 2023
311 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...
0 votes
0 votes
1 answer
2
Siddhi Viradiya asked Apr 3, 2016
1,789 views
i cannot understand the following explanation..how solution is (3/2)n-2???If n is a power of 2, then we can write T(n) as:T(n) = 2T(n/2) + 2After solving above recursion,...
19 votes
19 votes
8 answers
3
piyushkr asked Dec 30, 2015
43,404 views
The minimum number of comparisons required to sort 5 elements is -4567
0 votes
0 votes
0 answers
4
mehul vaidya asked Jan 29, 2019
605 views
The number of ways in which we can place 3 white pawns and 3 black pawns on a 3 . 3 Chessboard is equal to