719 views
2 votes
2 votes
Given the input sequence {11, 33, 43, 99, 34, 79, 19} and hash table of size 10 with the hash function h(k) = k mod 10. If hash table uses quadratic probing, the number of collisions occurred while mapping the given sequence is ______.

1 Answer

Best answer
5 votes
5 votes

1) 11mod10=1

2) 33 mod 10=3

3)43mod10=3 , collision occurs

therefore next place is obtained bu quadratic probing as (43+12)mod 10=4

4)99mod10=9

5)34mod10=4 so collision occurs ,

next place =(34+12)mod10=5

6)79mod10=9 collision

next place= (79+12)mod10=0

7)19mod10=9 collision ,

next place =(19+12)mod10=0 collision , next place= (19+22)mod10=3 collision, next place = (19+32)mod10=8

therefore total 6  collisions are there

selected by

Related questions

0 votes
0 votes
2 answers
1
altamash asked Nov 5, 2018
2,552 views
can any one explain double hashing example
6 votes
6 votes
0 answers
2
MiNiPanda asked Jan 21, 2018
2,308 views
Please explain primary and secondary clustering in brief. I tend to forget their difference because their definitions seem quite similar to me. And also, which one is tru...
0 votes
0 votes
2 answers
4
rahul sharma 5 asked Dec 4, 2017
1,633 views
S1 :- if load factor of hash table is less than 1 then there are no collisionS2:- As the size of hash table increases, the number of collisions will decrease.True false?