Question 3
Marks : +2 | -2
Pass Ratio : 100%
Which of the following is not a technique to avoid a collision?
Explanation: On increasing hash table size, space complexity will increase as we need to reallocate the memory size of hash table for every collision. It is not the best technique to avoid a collision. We can avoid collision by making hash function random, chaining method and uniform hashing.
Question 4
Marks : +2 | -2
Pass Ratio : 100%
Explanation: A hash table is used to implement associative arrays which has a key-value pair, so the has table maps keys to values.
Question 5
Marks : +2 | -2
Pass Ratio : 100%
What is simple uniform hashing?
Explanation: In simple uniform hashing, any given element is equally likely to hash into any of the slots available in the array.
Question 7
Marks : +2 | -2
Pass Ratio : 100%
What is direct addressing?
Explanation: Direct addressing is possible only when we can afford to allocate an array that has one position for every possible key.
Question 8
Marks : +2 | -2
Pass Ratio : 100%
In simple uniform hashing, what is the search complexity?
Explanation: There are two cases, once when the search is successful and when it is unsuccessful, but in both the cases, the complexity is O(1+alpha) where 1 is to compute the hash function and alpha is the load factor.
Question 9
Marks : +2 | -2
Pass Ratio : 100%
Explanation: In a hash table, there are fewer array positions than the keys, so the position of the key in the array has to be computed, this is done using the hash function.