What is the significance of the output size of a cryptographic hash function?
Affects the uniqueness of the hash for different inputs
Impacts the resistance against brute-force attacks
Determines the speed of hash computation
Influences the memory required to store the hash function
What is the primary advantage of using a hashmap over a simple array for storing and retrieving data?
Hashmaps provide faster access to data based on a key, while arrays require linear search in some cases.
Hashmaps can store duplicate keys, while arrays cannot.
Hashmaps maintain data in sorted order, unlike arrays.
Hashmaps use less memory than arrays.
What advantage does separate chaining have over open addressing techniques in hash table collision resolution?
Lower memory overhead
Handles load factors greater than 1 gracefully
Faster search times at high load factors
Simpler implementation
You are implementing an LRU (Least Recently Used) cache. Which data structure, in conjunction with a hashmap, is most suitable for tracking the usage order of cached items?
Binary Tree
Stack
Doubly Linked List
Queue
Which collision resolution technique involves using a second, independent hash function to compute the probe sequence?
Quadratic Probing
Double Hashing
Separate Chaining
Linear Probing
What is a primary disadvantage of using linear probing for collision resolution in a hash table?
Higher memory overhead compared to chaining
Not suitable for open addressing
Complex implementation
Increased potential for primary clustering
How does an increasing load factor generally impact the performance of a hashmap?
It has no significant impact on performance.
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.
How are deletions typically handled in a hashmap with open addressing to avoid creating 'holes' that disrupt search operations?
By simply removing the element, leaving the slot empty.
By shifting all subsequent elements one position back to fill the gap.
Deletions are not allowed in hashmaps with open addressing.
By marking the slot as "deleted" and implementing a mechanism to handle such markers during search and insertion.
Which collision resolution strategy is generally preferred for hash tables with open addressing when the load factor is low?
When does rehashing typically occur in a hashmap?
Every time a new key is inserted.
When the hash function is modified.
When the load factor exceeds a predetermined threshold.
When the hashmap is cleared using the clear() method.