Question 1
Consider the data given in above question. How many different insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above?
10
20
30
40
Question 2
A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.
Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
46, 42, 34, 52, 23, 33
34, 42, 23, 52, 33, 46
46, 34, 42, 23, 52, 33
42, 46, 33, 23, 34, 52
Question 3
The 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?
A
B
C
D
Question 4
Consider 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.
8, _, _, _, _, _, 10
1, 8, 10, _, _, _, 3
1, _, _, _, _, _,3
1, 10, 8, _, _, _, 3
Question 5
The following postfix expression with single digit operands is evaluated using a stack:
8 2 3 ^ / 2 3 * + 5 1 * - Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are:
6, 1
5, 7
3, 2
1, 5
Question 6
Consider a hash table with 9 slots. The hash function is ℎ(k) = k mod 9. The collisions are resolved by chaining. The following 9 keys are inserted in the order: 5, 28, 19, 15, 20, 33, 12, 17, 10. The maximum, minimum, and average chain lengths in the hash table, respectively, are
3, 0, and 1
3, 3, and 3
4, 0, and 1
3, 0, and 2
Question 7
Given 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?
1. 9679, 1989, 4199 hash to the same value
2. 1471, 6171 hash to the same value
3. All elements hash to the same value
4. Each element hashes to a different value
1 only
2 only
1 and 2 only
3 or 4
Question 8
Suppose we are given n keys, m hash table slots, and two simple uniform hash functions h1 and h2. Further, suppose our hashing scheme uses h1 for the odd keys and h2 for the even keys. What is the expected number of keys in a slot?
[Tex]\frac{n}{2m}[/Tex]
[Tex]\frac{n}{m}[/Tex]
[Tex]\frac{m}{n}[/Tex]
[Tex]\frac{2n}{m}[/Tex]
Question 9
Given a hash table T with 25 slots that stores 2000 elements, the load factor α for T is __________
80
0.0125
8000
1.25
Question 10
Consider a dynamic hashing approach for 4-bit integer keys:
Consider the following state of the hash table.

Which of the following sequences of key insertions can cause the above state of the hash table (assume the keys are in decimal notation)?
5,9,4,13,10,7
9,5,10,6,7,1
10,9,6,7,5,13
9,5,13,6,10,14
There are 15 questions to complete.