Which of the following is NOT a collision handling technique in hashmaps?
Linear Probing
Binary Search
Separate Chaining
Open Addressing
What is the primary advantage of using a hashmap over a linear search in an array when searching for a specific value?
Hashmaps use less memory.
Hashmaps can handle duplicate values more efficiently.
Hashmaps offer faster search times on average.
Hashmaps can store sorted data.
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 might require resizing, which can be an expensive operation.
They are more complex to implement than linked lists.
They are not suitable for storing data in a sorted order.
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.
What is the time complexity of inserting a key-value pair into a hashmap in the average case?
O(n log n)
O(log n)
O(1)
O(n)
What is the primary role of the modulo operator (%) in simple hash functions?
To generate a unique hash code for each key.
To handle collisions effectively.
To map the hash code to a valid index within the array's bounds.
To sort keys in ascending order based on their hash values.
Which of these data structures is commonly used to handle collisions in hashmaps?
Queue
Heap
Linked List
Binary Tree
What is a disadvantage of using a hashmap?
Cannot iterate over elements in a specific order.
Inability to handle collisions.
Keys must be immutable.
Slow search speed.
What does a hashmap store data in?
Sorted Array
Key-Value Pairs
What is a key advantage of using a hashmap over a sorted array for searching?
Hashmaps maintain data in sorted order.
Hashmaps offer faster search on average.
Hashmaps allow duplicate keys.
Hashmaps consume less memory.