Question

In: Computer Science

Suppose you have a collision resolution scheme that jumps ahead three positions after each collision rather...

Suppose you have a collision resolution scheme that jumps ahead three positions after each collision rather than one position as you do with linear probing. What would be a poor choice, in general terms, for the size of the hash table? Justify your answer with an example.

Solutions

Expert Solution

As we aware about what is collision in hash table, it happens when same value we try to put in one cell of hash table.

So to solve this Here collision resolution scheme is defined as to jumps ahead of three position after each collision rathen then one position.

So, besically the function is : whenever [(hash(x))%HASHTABLE_SIZE] is full.we will use.

[(hash(x) + 3)%HASHTABLE_SIZE] instead of [(hash(x) + 1)%HASHTABLE_SIZE] 

Here poor choice for HASHTABLE_SIZE can be following.

So, Data to insert into hash table is : 50, 700, 76, 85

and HASHTABLE_SIZE = 4

so, let's insert one by one into table.

index HASHTABLE
0 700
1 85
2 50
3 76-->collide at index 0

1. So, Form Here we have learnt that HASHTABLE_SIZE should be >3 always to utilize this function.

Now moving forward.

2. This may suffer with Primary Clustering Problem.

3. Always HASHTABLE_SIZE should be greater than total no of keys in data.


Related Solutions

Suppose that you are an employer and want to hire people for two positions. These positions...
Suppose that you are an employer and want to hire people for two positions. These positions pay different amounts and require different levels of skill or dedication. If you know that taking rigorous classes in college is a measure of how skilled or dedicated one is how can you use this information to design a mechanism to get the “right” people to the “right” job? Building off of the above information, suppose the cost of a hard class is $5,000...
Problem 1 Slot machines have three drums with the same number of positions on each drum....
Problem 1 Slot machines have three drums with the same number of positions on each drum. Each position contains a symbol. When you pull the lever on the machine, the drums spin. Assume that each drum is equally likely to stop in any position, and that the positions in which the three drums stop are independent of each other and independent from spin to spin. Suppose a particular slot machine has 9 positions on each drum, and that each position...
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. Write a function (merge-sorter L1) that takes list-of-integers L1 and returns all elements of L1 in sorted order. You must use a merge-sort technique that, in the recursive case, a) splits L1 into two approximately-equal-length lists, b) sorts those lists, and then c) merges the...
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. This problem need to use DrRacket software. Racket Language. Write a function named (forget-n L1 N) that returns the elements of L1 except for the first N. If N is negative, return all elements. If N exceeds the length of L1 return the empty list....
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. This problem needs to use DrRacket software. Racket Language. Write a function (indices L1 X) that takes a list of elements L1 and an element X. The function returns a list of the indices in L1 that contain X. See the following examples for clarification....
You must write each of the following scheme functions. You must use only basic scheme functions,...
You must write each of the following scheme functions. You must use only basic scheme functions, do not use third-party libraries to support any of your work. Do not use any function with side effects. This problem need to use DrRacket software. Racket Language. Write a function named (first-n L1 N) that returns the first N elements of L1. If N is negative, return the empty list. If N exceeds the length of L1 return all elements of L1. (first-n...
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. This problem need to use DrRacket software. Racket Language. Write a function (join-together L1 L2) that takes a sorted list (ascending) of integers L1 and a sorted list of elements L2 and returns a sorted list containing all elements of both L1 and L2. See...
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. Write a function (indices L1 X) that takes a list of elements L1 and an element X. The function returns a list of the indices in L1 that contain X. See the following examples for clarificaton. (indices '(a b c a e f a) 'a')...
You must write each of the following scheme functions. You must use only basic scheme functions...
You must write each of the following scheme functions. You must use only basic scheme functions do not use third-party libraries to support any of your work. Do not use any function with side effects. Write a function named (list-replace ALIST SYM VAL) that accepts a list of elements and returns that list where all SYM's (a single symbol) have been replaced by the VAL (some scheme value). The replacement must occur even within nested lists. For example: (list-replace '(a...
Suppose that jumps by Olympic men high jumpers have a normal distribution with a mean 2.12...
Suppose that jumps by Olympic men high jumpers have a normal distribution with a mean 2.12 meters and standard deviation 0.12 meters; women's jumps have a normal distribution with a mean 1.80 meters and standard deviation 0.09 meters. A man and woman Olympic high jumper are picked at random. (a) What is the probability the sum of their jumps is over 4 meters? ( b) What is the probability that the man jumped higher than the woman?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT