Which collision resolution technique is commonly used in hashmaps?
Separate Chaining
Merge Sort
Bubble Sort
Binary Search
In hashmap collision resolution, what does separate chaining involve?
Using a secondary hash function to resolve collisions.
Finding the next available empty slot in the hash table.
Storing colliding elements in a separate overflow area.
Creating linked lists at each index of the hash table to store colliding elements.
What is the purpose of a load factor in a hashmap?
To store the maximum number of key-value pairs.
To count the number of collisions.
To determine when to resize the hashmap.
To measure the efficiency of the hash function.
What is a key advantage of using a hashmap over a sorted array for searching?
Hashmaps maintain data in sorted order.
Hashmaps consume less memory.
Hashmaps offer faster search on average.
Hashmaps allow duplicate keys.
A simple hash function for strings could involve summing the ASCII values of each character in the string. What is a potential drawback of this approach?
It can lead to a high number of collisions for anagrams.
It's not reversible, meaning you can't get the original string from the hash.
It's computationally expensive.
It can't handle strings of varying lengths.
Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Insertion
Deletion
All of the above
Search
Which characteristic of a hash function is undesirable and can lead to performance degradation?
Uniform Distribution
High Collision Rate
Fast Computation
Deterministic
What is the time complexity, in the average case, for searching for a key in a well-implemented hashmap?
O(n log n)
O(1)
O(n)
O(log n)
What is a disadvantage of using a hashmap?
Slow search speed.
Inability to handle collisions.
Keys must be immutable.
Cannot iterate over elements in a specific order.
Which of the following is NOT a typical operation supported by hashmaps?
Insert
Delete
Sort