Question 21
Given a hash table T with 25 slots that stores 2000 elements, the load factor α for T is __________
Question 22
Question 23
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?
[caption width="800"] [/caption]Question 24
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.
[caption width="800"] [/caption]Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
Question 25
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?
Question 26
Output of given program is,
def findSymPairs(arr, row):
hM = dict()
for i in range(row):
first = arr[i][0]
sec = arr[i][1]
if (sec in hM.keys() and hM[sec] == first):
print("(", sec,",", first, ")")
else:
hM[first] = sec
if __name__ == '__main__':
arr = [[0 for i in range(2)]
for i in range(5)]
arr[0][0], arr[0][1] = 11, 20
arr[1][0], arr[1][1] = 30, 40
arr[2][0], arr[2][1] = 5, 10
arr[3][0], arr[3][1] = 40, 30
arr[4][0], arr[4][1] = 10, 5
findSymPairs(arr, 5)
Question 28
Which is a simple form of hashing where the data is directly mapped to an index in a hash table.
There are 30 questions to complete.