Thread: Hash tables - chaining

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    19

    Hash tables - chaining

    Does anybody know of a Hash Chaining algorithm or a web page for it?

    I am trying to implement a hash table with searching and insertion.

    Many thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Here's one.

    First of all, each element of the hash array is actually a linked list. If hasharray[index] != EmptyList, then call List_add (or inser or whatever) to that list. When searching, just do a search on the list if it's not null, if it is then the search return false.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Iterable hash tables
    By OnionKnight in forum Tech Board
    Replies: 5
    Last Post: 07-21-2008, 02:02 AM
  2. need help with hash tables with direct chaining
    By agentsmith in forum C Programming
    Replies: 4
    Last Post: 01-05-2008, 04:19 AM
  3. Group Project Help/Volunteer
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 04-24-2007, 11:36 PM
  4. Chaining Hash Tables (in C)
    By sql.scripter in forum C Programming
    Replies: 18
    Last Post: 09-25-2006, 01:05 AM
  5. Help with beginning hash tables, please.
    By Will in forum C++ Programming
    Replies: 8
    Last Post: 11-17-2002, 09:51 PM