Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formulas needed for calculating statistic using hashing.

 
Dubravko Zubavich
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone ?
 
Piet Verdriet
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dhruva Mistry
Ranch Hand
Posts: 67
Eclipse IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic