What is the significance of the output size of a cryptographic hash function?
Determines the speed of hash computation
Impacts the resistance against brute-force attacks
Affects the uniqueness of the hash for different inputs
Influences the memory required to store the hash function
How does quadratic probing aim to mitigate the clustering problem in open addressing?
By probing with exponentially increasing intervals
By probing linearly with a fixed step size
By probing with quadratically increasing intervals
By using a second hash function to determine the probe sequence
In the context of hashmaps, what does 'probing' refer to?
Resizing the underlying array to accommodate more keys.
Determining the load factor of the hashmap.
Finding an alternative slot for a key when a collision occurs.
Searching for a specific key in the hashmap.
What is the primary motivation behind designing hash functions with a uniform distribution property?
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
To simplify the implementation of the hash function itself
You need to identify the first non-repeating character in a string. How can a hashmap be utilized to solve this problem efficiently?
A hashmap cannot be used efficiently for this problem.
Use the hashmap to store the unique characters of the string, then iterate through the hashmap to find the first non-repeating character.
Store the frequency of each character in the hashmap, then iterate through the string and return the first character with a frequency of 1.
Store the characters of the string as keys in the hashmap, and their positions as values. The first character with the lowest position value is the first non-repeating character.
What is a potential drawback of using double hashing for collision resolution compared to linear or quadratic probing?
Requires dynamic memory allocation for linked lists
Not suitable for use with open addressing
Higher risk of primary clustering
Increased computational cost due to the second hash function
When does rehashing typically occur in a hashmap?
Every time a new key is inserted.
When the load factor exceeds a predetermined threshold.
When the hashmap is cleared using the clear() method.
When the hash function is modified.
In the context of hash functions, what does the avalanche effect refer to?
Gradual degradation of hash performance over time
Increased likelihood of hash collisions with larger datasets
A small change in input causing a significant change in output
Uneven distribution of keys within the hash table
What is a significant disadvantage of using a fixed-size hash table in conjunction with a hash function prone to collisions?
Complexity in implementing the hash function itself
Degraded performance due to chaining or open addressing for collision resolution
Increased memory usage due to the fixed size allocation
Inability to store data that exceeds the pre-defined table size
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.
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.
By shifting all subsequent elements one position back to fill the gap.