Hashing - Linear Probing

This is a discussion on Hashing - Linear Probing within the C++ Programming forums, part of the General Programming Boards category; Help....I'm hoping someone can do a better job explaining 'hashing - linear probing' than this book I'm reading. I'm just ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    3

    Hashing - Linear Probing

    Help....I'm hoping someone can do a better job explaining 'hashing - linear probing' than this book I'm reading. I'm just looking for the explaination, not any code. I'm trying to insert 'EASYQUTION' into an initally empty hash table witha size of M = 16. I'm using the hash function 11k mod M to transform the kth letter into a table index. If anyone can explain the process or send me a link it would be greatly appreciated.

  2. #2
    Registered User programmer's Avatar
    Join Date
    Oct 2001
    Posts
    22

    Thumbs up

    A hashing algoritm is just an expression to create a unique value for given data(most hashing algorithms i have seen only produce a limited amount of unique values).

    an example of a hashing algorithm I have uses vehicle registrations as its data:

    say you had the reg number B123BCD:

    the algorithm is, take the integer value of the first letter 'B' and subtract 'A' from it, then multiply the result by 1000. So far we have a value of 1000. Next we add the next 3 digits 123, so now we have a value of 1123. This is our unique value(actually this method only produces 26000 different values). So you would store the registration number in position 1123 of the array/file.

    You need to make sure your data is in the correct format and if data already exists in the position 1123, i would write the new data to an error file or just tell the user, i wouldn't try to store it elsewhere because retriving it using the same algorithm would get the wrong data.

    Hope this helps.

  3. #3
    Registered User programmer's Avatar
    Join Date
    Oct 2001
    Posts
    22

  4. #4
    Registered User programmer's Avatar
    Join Date
    Oct 2001
    Posts
    22

    Cool

    I'm not sure whether the link will work or not...... sorry.
    "MeSs WiTh BeSt DiE lIkE tHe ReSt*

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    3
    unable to get to that site...anyone else have any ideas??

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linear Programming
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 12-20-2007, 09:53 PM
  2. Creating Linked List Using Hashing and Stack
    By m0ntana in forum C Programming
    Replies: 2
    Last Post: 04-07-2007, 08:11 AM
  3. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 06:20 AM
  4. Question 39: Quicksort vs Linear Search
    By Kleid-0 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-17-2005, 12:03 PM
  5. Problem with Hash Table Linear Probing
    By kirby1024 in forum C Programming
    Replies: 5
    Last Post: 10-23-2002, 07:03 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21