Which collision resolution technique is commonly used in hashmaps?
Separate Chaining
Bubble Sort
Binary Search
Merge Sort
You want to update the value associated with a key in a hashmap. What is the general process involved?
Calculate the hash of the key, find the corresponding bucket, and directly modify the value.
Hashmaps do not support value updates; you need to create a new hashmap.
Search for the key sequentially, and update the value when found.
Delete the existing key-value pair, then insert a new one with the updated value.
What is a significant disadvantage of using a hashmap when you need to retrieve elements in a sorted order?
Hashmaps have slow insertion times.
Hashmaps don't inherently maintain order.
Hashmaps cannot handle duplicate values.
Hashmaps have high memory consumption.
In hashmap terminology, what does a 'bucket' typically refer to?
A linked list or other data structure used to handle collisions.
The load factor of the hashmap.
The range of possible hash values produced by the hash function.
An individual element within the hashmap's array.
What is a real-world application of hashmaps?
Performing depth-first search in a graph.
Compressing files to reduce storage space.
Sorting a list of numbers in ascending order.
Storing and retrieving data in databases.
What is a disadvantage of using hashmaps when the number of elements to be stored is not known in advance?
They are less memory-efficient than arrays for storing a fixed number of elements.
They are more complex to implement than linked lists.
They might require resizing, which can be an expensive operation.
They are not suitable for storing data in a sorted order.
In hashmap terminology, what does 'collision' refer to?
When a hash function produces the same output for all inputs.
When trying to delete a key that doesn't exist.
When two hashmaps have the same size.
When two keys map to the same index in the hashmap.
What is the purpose of a load factor in a hashmap?
To measure the efficiency of the hash function.
To store the maximum number of key-value pairs.
To determine when to resize the hashmap.
To count the number of collisions.
What is the time complexity of inserting a key-value pair into a hashmap in the average case?
O(1)
O(n)
O(n log n)
O(log n)
Which of the following is NOT a collision handling technique in hashmaps?
Open Addressing
Linear Probing