Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Insertion
Search
Deletion
All of the above
Which of the following data structures is commonly used to implement a hashmap?
Graph
Array
Linked List
Tree
Which of the following is NOT a collision handling technique in hashmaps?
Open Addressing
Separate Chaining
Linear Probing
Binary Search
Which characteristic of a hash function is undesirable and can lead to performance degradation?
Fast Computation
High Collision Rate
Uniform Distribution
Deterministic
What is the time complexity of inserting a key-value pair into a hashmap in the average case?
O(log n)
O(n)
O(1)
O(n log n)
Which of these is a disadvantage of open addressing compared to separate chaining in hashmaps?
Clustering of elements can lead to performance degradation.
Requires more complex implementation compared to chaining.
Cannot handle a large number of collisions efficiently.
Increased memory usage due to linked lists.
What is a disadvantage of using a hashmap?
Inability to handle collisions.
Cannot iterate over elements in a specific order.
Keys must be immutable.
Slow search speed.
You want to update the value associated with a key in a hashmap. What is the general process involved?
Delete the existing key-value pair, then insert a new one with the updated value.
Search for the key sequentially, and update the value when found.
Hashmaps do not support value updates; you need to create a new hashmap.
Calculate the hash of the key, find the corresponding bucket, and directly modify the value.
What is a disadvantage of using hashmaps when the number of elements to be stored is not known in advance?
They might require resizing, which can be an expensive operation.
They are not suitable for storing data in a sorted order.
They are more complex to implement than linked lists.
They are less memory-efficient than arrays for storing a fixed number of elements.
In hashmap collision resolution, what does separate chaining involve?
Storing colliding elements in a separate overflow area.
Using a secondary hash function to resolve collisions.
Finding the next available empty slot in the hash table.
Creating linked lists at each index of the hash table to store colliding elements.