What is a potential drawback of using double hashing for collision resolution compared to linear or quadratic probing?
Higher risk of primary clustering
Increased computational cost due to the second hash function
Requires dynamic memory allocation for linked lists
Not suitable for use with open addressing
What advantage does separate chaining have over open addressing techniques in hash table collision resolution?
Handles load factors greater than 1 gracefully
Faster search times at high load factors
Lower memory overhead
Simpler implementation
How does quadratic probing aim to mitigate the clustering problem in open addressing?
By probing linearly with a fixed step size
By using a second hash function to determine the probe sequence
By probing with quadratically increasing intervals
By probing with exponentially increasing intervals
When does rehashing typically occur in a hashmap?
When the load factor exceeds a predetermined threshold.
When the hashmap is cleared using the clear() method.
When the hash function is modified.
Every time a new key is inserted.
In a system where memory usage is a major concern, what trade-off should be considered when using a hashmap?
A larger hash table size generally results in faster lookups but consumes more memory.
Using a complex hash function always reduces collisions and memory usage.
Collision resolution strategies have no impact on memory consumption.
Hashmaps always use less memory than arrays for storing the same data.
How does an increasing load factor generally impact the performance of a hashmap?
It improves performance by reducing memory usage.
It depends on the specific hash function being used.
It degrades performance due to a higher probability of collisions.
It has no significant impact on performance.
In a web server, which scenario is best suited for using a hashmap to optimize performance?
Maintaining a log of all incoming requests in chronological order
Storing and retrieving user session data
Storing and retrieving static website content like images and CSS files
Managing the order of user connections to ensure fairness
Which of the following scenarios could potentially lead to collisions in a hashmap?
Hashing two different keys to the same index in the hash table
Using a hash function that distributes keys evenly across the hash table
Having a hash table size much larger than the number of keys being stored
Storing keys with a wide range of values
What is the primary motivation behind designing hash functions with a uniform distribution property?
To simplify the implementation of the hash function itself
To minimize the occurrence of hash collisions and improve efficiency
To maximize the amount of data that can be stored in the hash table
To reduce the memory footprint of the hash table
What is a significant disadvantage of using a fixed-size hash table in conjunction with a hash function prone to collisions?
Inability to store data that exceeds the pre-defined table size
Degraded performance due to chaining or open addressing for collision resolution
Complexity in implementing the hash function itself
Increased memory usage due to the fixed size allocation