Thread: What is a Hash Table?

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    95

    What is a Hash Table?

    Is it anything like a Queu?

  2. #2
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    Nothing like a queue. IMO, the best way to describe a hash table is an array that can index with things other than integers.
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  3. #3
    drekce
    Guest

    Lightbulb

    A hash table is a data structure that is used to store large (or small) amounts of data that must be found very quickly. Everythime that something needs to be stored in the hash table it is run through some algorithm that extacts a number based on the data (called its hash). This number is then used to index the data. When someone then needs to find the data stored there, they run the name (or whatever is used to create the hash) through the hash function and use that value to find the data in the hash table. This is a very basic example. What happens if two pieces of data happen to have the same hash number? In this case you need to add in schemes that can handle events like these. you could create a linked hash table (using a linked list at each hash point), you could create another algorithm to decide where to put the data, or you could simply place it at the next free spot.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    95
    Thanks for your responses. I had an idea for a password program in wich the password changes based on some function. Perhaps I could use a hash table. Actually I would like to combine the current static password with some dynamic function that would calculate the actual password.

    It may take a little thinking and a calculator to get the latest password

    Thanks again!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dictionary in C# to hash table in C?
    By dinoman in forum C Programming
    Replies: 2
    Last Post: 04-12-2009, 09:23 PM
  2. Writing array, to file
    By zootreeves in forum C Programming
    Replies: 9
    Last Post: 09-08-2007, 05:06 PM
  3. Group Project Help/Volunteer
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2007, 11:36 PM
  4. Hash table creation and insertion
    By tgshah in forum C Programming
    Replies: 1
    Last Post: 01-23-2006, 07:54 PM
  5. Not sure on hash table memory allocations
    By Thumper333 in forum C Programming
    Replies: 3
    Last Post: 09-27-2004, 09:00 PM