Which of the following is NOT a typical operation supported by hashmaps?
Delete
Search
Sort
Insert
In hashmap collision resolution, what does separate chaining involve?
Using a secondary hash function to resolve collisions.
Storing colliding elements in a separate overflow area.
Creating linked lists at each index of the hash table to store colliding elements.
Finding the next available empty slot in the hash table.
What is a disadvantage of using hashmaps when the number of elements to be stored is not known in advance?
They are not suitable for storing data in a sorted order.
They are less memory-efficient than arrays for storing a fixed number of elements.
They might require resizing, which can be an expensive operation.
They are more complex to implement than linked lists.
Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Deletion
All of the above
Insertion
What is a disadvantage of using a hashmap?
Cannot iterate over elements in a specific order.
Slow search speed.
Keys must be immutable.
Inability to handle collisions.
Which of the following is NOT a collision handling technique in hashmaps?
Linear Probing
Separate Chaining
Binary Search
Open Addressing
What is a real-world application of hashmaps?
Sorting a list of numbers in ascending order.
Storing and retrieving data in databases.
Performing depth-first search in a graph.
Compressing files to reduce storage space.
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.
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.
Search for the key sequentially, and update the value when found.
Which of these is NOT a desirable property of a good hash function?
It should distribute keys uniformly across the hash table.
It should minimize collisions as much as possible.
It should be computationally expensive to calculate.
It should be deterministic (same input always yields the same output).
What is the primary role of the modulo operator (%) in simple hash functions?
To handle collisions effectively.
To map the hash code to a valid index within the array's bounds.
To generate a unique hash code for each key.
To sort keys in ascending order based on their hash values.