Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About secondary clustering in hash tables

Tags:

algorithm

Although quadratic probing eliminates primary clustering, elements that hash to the same position will probe the same alternate cells. This is known as secondary clustering. Simulation results suggest that it generally causes less than an extra probe per search.

Above is text snippet from algorihms book from Mark Allen Wessis book.

My question can some one explain with example what is secondary clustring and what does author mean by "Simulation results suggest that it generally causes less than an extra probe per search".

Thanks!

like image 441
venkysmarty Avatar asked Dec 31 '25 11:12

venkysmarty


1 Answers

Secondary clustering is defined in the piece of text you quoted: instead of near the insertion point, probes will cluster around other points.

"Simulation results suggest that it generally causes less than an extra probe per search" means someone tried to insert or find lots of data in a hash table with quadratic probing, and found that, on average, less than two probes were needed to find the right spot in the hash table. (One probe is of course the minimum needed to insert or find anything in a hash table.)

like image 185
Fred Foo Avatar answered Jan 05 '26 07:01

Fred Foo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!