Thread: what's the point?

  1. #1
    Registered User Draco's Avatar
    Join Date
    Apr 2002

    what's the point?

    I've been reading a book about data structures and today I read through the chapter on hash tables. I understand the topic well, but the one thing the book didn't really cover is the point to using hash tables. I can't think of any real use where a hash table will be more effective than something else(I do know that hash tables are used later in the book, for things like compression and advanced filing/searching). Maybe I'm missing some of the point of hash tables.

  2. #2
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    i think ext2 uses hash tables to access files quicker, if I remember right.
    // for those who don't know, ext2 is a filesystem like fat32 or ntfs
    Last edited by chrismiceli; 08-18-2003 at 06:44 AM.

  3. #3
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    That's exactly right. The point of a hash table is faster searching. Consider a linked list with many entries. To find a given entry, you start at the beginning, and increment through the list until you find the one you want.

    With a hash table, you have automaticly (based on the hash key) reduced your search times by N amount, where N is the number of buckets in your hash table.

    So if you have 100 entries, and 10 buckets, you have effectively reduced your search time to 1/10th of what it would normally take.

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help realy needed
    By ZohebN in forum C++ Programming
    Replies: 2
    Last Post: 04-08-2008, 09:37 AM
  2. Getting a floating point exception
    By SnertyStan in forum C Programming
    Replies: 13
    Last Post: 03-25-2008, 11:00 AM
  3. How to monitor process creation?
    By markiz in forum Windows Programming
    Replies: 31
    Last Post: 03-17-2008, 02:39 PM
  4. floating point binary program, need help
    By ph34r me in forum C Programming
    Replies: 4
    Last Post: 11-10-2004, 07:10 AM
  5. point lies in circle?
    By cozman in forum Game Programming
    Replies: 3
    Last Post: 12-20-2001, 04:39 PM