Win a copy of Fixing your Scrum this week in the Agile forum!
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Ron McLeod
• Paul Clapham
• Rob Spoor
• Liutauras Vilda
Sheriffs:
• Jeanne Boyarsky
• Junilu Lacar
• Tim Cooke
Saloon Keepers:
• Tim Holloway
• Piet Souris
• Stephan van Hulst
• Tim Moores
• Carey Brown
Bartenders:
• Frits Walraven
• Himai Minh

# Formulas needed for calculating statistic using hashing.

Greenhorn
Posts: 20
• Number of slices to send:
Optional 'thank-you' note:
I am working on calculating statistics information using hash tables. My book provides formulas for calculating load factor, average number of elements examined during a successful search using hashing with linear probing, double hashing and chained hashing.

I was wondering if someone knows or can point me to a link which can tell me how to calculate the maximum number of items examined during a successful search for all these three hashing methods.

Thank you.

Dubravko Zubavich
Greenhorn
Posts: 20
• Number of slices to send:
Optional 'thank-you' note:
anyone ?

Ranch Hand
Posts: 266
• Number of slices to send:
Optional 'thank-you' note:

Dubravko Zubavich wrote:...

I was wondering if someone knows or can point me to a link which can tell me how to calculate the maximum number of items examined during a successful search for all these three hashing methods.

Thank you.

A hash table is nothing more than an array of linked lists. So, iterate over that array, and on each item (linked list) in that array, check it's size. The maximum number of items examined during a successful search is the size of the biggest list.

Ranch Hand
Posts: 67
• Number of slices to send:
Optional 'thank-you' note:

Dubravko Zubavich wrote:I am working on calculating statistics information using hash tables. My book provides formulas for calculating load factor, average number of elements examined during a successful search using hashing with linear probing, double hashing and chained hashing.

I was wondering if someone knows or can point me to a link which can tell me how to calculate the maximum number of items examined during a successful search for all these three hashing methods.

Thank you.

you can creat 1 static int variable that will get incremented after getting done with search method and when the whole loop will get finished, you can display that static int variable and that will show you no of amount search did

 Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad: the value of filler advertising in 2021 https://coderanch.com/t/730886/filler-advertising