Hash Tables
1. Which of the following is an advantage of using a hash table for storing key-value pairs?
2. What happens when two different keys are mapped to the same index by a hash function?
3. What is the expected average-case time complexity of searching for a key in a well-designed hash table?
4. In which of the following applications can hash tables be used?
5. Consider a hash table containing elements. If all keys happen to be mapped to the same index and collisions are handled using separate chaining, what can be the worst-case time complexity of searching for a key?
6. What is the load factor of a hash table with stored elements and table size ?
7. Which property is most desirable for a hash function used in a hash table?
8. Suppose the hash function is . What index is produced for the key ?
9. Why can a hash table have worst-case search time even though its expected search time is often ?