Questions tagged [linear-probing]

Questions about linear probing, the technique for resolving collisions in hash tables.

52 questions
1
vote
2 answers

what does clustering( in the collision)in hash mean?

The main problem with linear probing is clustering, many consecutive elements form groups and it starts taking time to find a free slot or to search an element. Why consecutive element from group & how does it affect the time to find free slot?
Dipok Dipu
  • 321
  • 1
  • 3
  • 6
1
vote
1 answer

Linear probing not working for collision

I am making a hash table based on reg no. The insertion function is working fine but the search and deletion doesn't work in case of collision. It's not doing anything at all. There aren't any compilation errors either. Any help would be…
Ashrav
  • 23
  • 4
1
vote
1 answer

Collision Resolution Linear Probing Java

So I am trying to detect for collisions in my linear method, which is hashing the keys of my hash map studentMap. I have the basic function for the linear probing, however I am struggling to detect if a key is already there (and therefore + 1). So…
pickle
  • 11
  • 3
1
vote
0 answers

Java: Linear Probing Remove method

i'm supposed to implement my own hash table through linear probing, however i'm having trouble with the remove function. it doesn't work correctly but i can't pinpoint the problem: public void remove(Student s){ if(s==null) throw new…
Meowzen
  • 113
  • 1
  • 3
  • 15
1
vote
1 answer

hashmap and probing - AVAILABLE and null?

In linear probing there is a special value called AVAILABLE which is replaced when items are removed. And when you are inserting a key you look for a empty cell (this just means the cell is null?) or one that contains AVAILABLE, what I don't…
orange
  • 5,297
  • 12
  • 50
  • 71
0
votes
1 answer

how do i get my linear probing hash table to increment the number of probe properly?

I'm meant to be computing weights that optimise the insertion of a specific list of names into a hash table using linear probing. I ran into a problem when trying to use "+=" with a void and int value. Can anyone help with letting me know where my…
0
votes
0 answers

linear probing, get prob range function

def get_prob_range(self, index): return [*range(index, len(self.arr))] + [*range(0, index)] I don't understand what is the "*" for at the return statement.
meowmeow
  • 11
  • 3
0
votes
1 answer

Hashing with division remainder method

I don't understand this exercise. Hash the keys: (13,17,39,27,1,20,4,40,25,9,2,37) into a hash table of size 13 using the division-remainder method. a) find a suitable value for m. b) handle collisions using linked lists andvisualize theresult in a…
0
votes
0 answers

Hashtable which uses linear probing

Suppose I have the following hash table which uses linear probing: [Amy,Barry,None,None,Carlie,Darren] which start at index 0. What is the possible value could hash(Amy) be? My answer to this is 0, but I don't feel like Im correct. Some help would…
Ben
  • 1
  • 1
0
votes
0 answers

How should I implement the search function for all the keys that exists if I have a Hash Table that uses Linear Probing to handle collisions?

According to my understanding of linear probing, if I don't find the key:value that I'm looking for, I should just go on to the next spot in the hash table. So I can stop at the first key that matches the result I've found and return that result and…
Raine
  • 26
  • 5
0
votes
1 answer

Linear probing hash in Mark Allen Weiss 's book

In data structure and algorithm analysis in C++ 's hash related chapters, λ is the load factor of a hast table,,When the author talks about linear probing which to resolve collisions,There's a sentence I can't understand: We will assume a very…
0
votes
1 answer

how to check if an index in an array is not intitated without checking it equality with 0 or null in java?

I was working on linear probing. Which hashes the values on mod of table size and wrote some code for it. public class LinearProbing { private int table[]; private int size; LinearProbing(int size) { this.size=size; …
0
votes
1 answer

How to count the number of collisions in hash table?

Here's the task: "Develop a program for the formation and processing of hash tables, built on the principle of open addressing (private hashing). Practical evaluation of hash tables for the set structure, including the data key N-bit digital code (N…
Sollpix
  • 49
  • 5
0
votes
0 answers

Linear Probing - Delete Function Not Working Properly

Here's a snippet of a Linear Probing program that I'm working on. I'm focusing on the insertElement and deleteElement functions: class HashMapTable { // initializing the size of the hash table int table_size; // a pointer* vector that…
0
votes
1 answer

I have implemented Linear Probing in the attached code. How can we modify it such that even negative values are handled? For eg if -1 was an entry

I'm trying to implement linear probing. I want to know how negative values are handled in this technique. In the below code, I have written a function for positive values. Also, what if -1 was an element in the array? How are we going to handle…