Hash Tables
Results 1 to 7 of 7

Thread: Hash Tables

  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    3

    Hash Tables

    Hello everyone im just getting started and i want to say thanks to all of you that reply to my thread!!
    Now the thing is, im doing a school project, and im not very experienced at C languange programming but i heard about hash tables and and hash functions would anyone give me some info about that and where i can find some hash functions !!
    \"...Choose life, choose job, choose a career...but why the ***** would i do something like that...\"!!!

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Posts
    211
    welcome to AO HUGOBOSS ...
    have u tried to visit cprogramming.com ? many thread had been posted here ( in AO forum ) you can see whole thread and you will get what you need.
    And about Has Tables you can find the tutorial at http://vergil.chemistry.gatech.edu/r...ial/lists.html
    http://users.actcom.co.il/~choo/lupg...sh-tables.html
    http://xml-lit.sourceforge.net/doc/indexs05.html

    good luck
    When I lay me down to sleep, Pray the LORD my soul to keep.
    If I die before i wake, Pray the LORD my soul to take.

    http://www.AntiOnline.com/sig.php?imageid=389

  3. #3
    Senior Member
    Join Date
    Feb 2003
    Posts
    118
    Hash table are often used with list to speed up search. The hash function depends on the data you work with. For example you work with words. The hash function can return a number between 0 to 25 according to the first character of the word. So you have the hash table (an array of 26) and after 26 list for the words. The hash function can also be the sum of the ascii characters of the worlds.

    You can find an example with C source Here
    or an other one Here.

  4. #4
    Junior Member
    Join Date
    Mar 2003
    Posts
    14
    u can find more info at code.box.sk

    and more : techiwarehouse.com

  5. #5
    Senior Member
    Join Date
    Jul 2001
    Posts
    420
    Originally posted here by Ghostdog
    Hash table are often used with list to speed up search. The hash function depends on the data you work with. For example you work with words. The hash function can return a number between 0 to 25 according to the first character of the word. So you have the hash table (an array of 26) and after 26 list for the words. The hash function can also be the sum of the ascii characters of the worlds.

    You can find an example with C source Here
    or an other one Here.
    Wrote a Hash program that hashed based off the first letter and my TA (teaching assistant) gave me credit for the lab but told me that 26 base hash was not very good. I am speculating that it would be better to hash on fewer letters (maybe like a telephone hash shifting 2 places to the left). But I never followed up with the TA so I'm not sure where he was coming from. It might a performance issue. Would love to get the take of others.

    Cheers,
    -D
    If you spend more on coffee than on IT security, you will be hacked. What\'s more, you deserve to be hacked.
    -- former White House cybersecurity adviser Richard Clarke

  6. #6
    Banned
    Join Date
    Apr 2003
    Posts
    3,839
    heres another nice URL

    C Library Functions

    http://www.doc.ic.ac.uk/~mac/manuals...hpux.man3.html

  7. #7
    Senior Member
    Join Date
    Feb 2003
    Posts
    118
    dspeidel said

    Wrote a Hash program that hashed based off the first letter and my TA (teaching assistant) gave me credit for the lab but told me that 26 base hash was not very good.
    This was just an example of a very simple function. The best hash function is a function who return a unique key for each words. In fact you have to find a function who's balance between the number of hash table entry and the list's length.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •