• Post Reply Bookmark Topic Watch Topic
  • New Topic
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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using lookup in Hash tables

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am taking my first course in Java, and I am way off base.
I'm trying out exercises from The Practice of Programming book. I'm working on this exercise:

Change lookup so that if the average list length becomes more than x, the array is grown automatically by a factor of y and the hash table is rebuilt.

Any help will do..
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you're coding your own hashtable there, instead of using Java's Hashtable class. I bet a C programming language newsgroup would be a good place for a question like that, if you don't find people that 'roll their own' hashtable here.
 
Nicole Collins
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response Cindy.
This is actually a Java course, so I'm stuck on figuring out where to start, etc.
 
Cindy Carney
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, maybe this will help. Animation of Hash Table

It shows you in a Java applet, how a hash table works. Click the 'Execute' button, then the 'Run' button, to see it insert numbers into a hashtable one by one, while simultaneously showing the code it's executing.

It offers several different hash algorithms to watch.
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic