Hashing
Quizsummary
0 of 9 questions completed
Questions:
 1
 2
 3
 4
 5
 6
 7
 8
 9
Information
Fundamental questions on Hashing.
You must specify a text. 

You must specify an email address. 
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 9 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
 Not categorized 0%
 1
 2
 3
 4
 5
 6
 7
 8
 9
 Answered
 Review

Question 1 of 9
1. Question
1 pointsTick all the open addressing approaches to hash table collisions:
Correct
Incorrect

Question 2 of 9
2. Question
1 pointsWhat is the bigO complexity to retrieve from a hash table if there are no collisions?
Correct
Incorrect

Question 3 of 9
3. Question
1 pointsWhat is the bigO complexity to insert n new elements into a hash table if there are no collisions?
Correct
Incorrect

Question 4 of 9
4. Question
1 pointsWhat is the disadvantage of using an array of even size as the basis for a hash table?
Correct
Incorrect

Question 5 of 9
5. Question
1 pointsTick all that are true: A hash function should have which properties?
Correct
Incorrect

Question 6 of 9
6. Question
1 pointsThe keys 12, 18, 13, 2, 3, 23, 5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?
Correct
Incorrect
Open addressing, or closed hashing, is a method of collision resolution in hash tables. With this method a hash collision is resolved by probing, or searching through alternate locations in the array (the probe sequence) until either the target record is found, or an unused array slot is found, which indicates that there is no such key in the table. Well known probe sequences include:
linear probing in which the interval between probes is fixed–often at 1.
quadratic probing in which the interval between probes increases linearly (hence, the indices are described by a quadratic function).
double hashing in which the interval between probes is fixed for each record but is computed by another hash function. 
Question 7 of 9
7. Question
1 pointsConsider a hash table of size seven, with starting index zero, and a hash function (3x + 4)mod7. Assuming the hash table is initially empty, which of the following is the contents of the table when the sequence 1, 3, 8, 10 is inserted into the table using closed hashing? Note that ‘_’ denotes an empty location in the table.Correct
Incorrect
Let us put values 1, 3, 8, 10 in the hash of size 7.
Initially, hash table is empty
       0 1 2 3 4 5 6
The value of function (3x + 4)mod 7 for 1 is 0, so let us put the value at 0
1       0 1 2 3 4 5 6
The value of function (3x + 4)mod 7 for 3 is 6, so let us put the value at 6
1      3 0 1 2 3 4 5 6
The value of function (3x + 4)mod 7 for 8 is 0, but 0 is already occupied, let us put the value(8) at next available space(1)
1 8     3 0 1 2 3 4 5 6
The value of function (3x + 4)mod 7 for 10 is 6, but 6 is already occupied, let us put the value(10) at next available space(2)
1 8 10    3 0 1 2 3 4 5 6

Question 8 of 9
8. Question
1 pointsGiven the following input (4322, 1334, 1471, 9679, 1989, 6171, 6173, 4199) and the hash function x mod 10, which of the following statements are true?
i. 9679, 1989, 4199 hash to the same value
ii. 1471, 6171 has to the same value
iii. All elements hash to the same value
iv. Each element hashes to a different valueCorrect
Incorrect

Question 9 of 9
9. Question
1 pointsConsider a hash table with 100 slots. Collisions are resolved using chaining. Assuming simple uniform hashing, what is the probability that the first 3 slots are unfilled after the first 3 insertions?Correct
Incorrect