Help with hash tables and quadratic probing in Java

Posted by user313458 on Stack Overflow See other posts from Stack Overflow or by user313458
Published on 2010-04-10T12:34:32Z Indexed on 2010/04/10 12:43 UTC
Read the original article Hit count: 352

Filed under:
|
|
|

I really need help with inserting into a hash table. I'm just not totally getting it right now. Could someone explain quadratic and linear probing in layman's terms?

public void insert(String key)
{
    int homeLocation = 0;
    int location = 0;
    int count = 0;

    if (find(key).getLocation() == -1)  // make sure key is not already in the table
    {
       //****** ADD YOUR CODE HERE FOR QUADRATIC PROBING  ********
    }
}

This is the code I'm working on. I'm not asking anyone to do it, I just really need help with learning the whole concept

Any help would be greatly appreciated.

© Stack Overflow or respective owner

Related posts about hashtable

Related posts about insert