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
Inability to store data that exceeds the pre-defined table size
Degraded performance due to chaining or open addressing for collision resolution
Increased memory usage due to the fixed size allocation
When does rehashing typically occur in a hashmap?
Every time a new key is inserted.
When the hash function is modified.
When the hashmap is cleared using the clear() method.
When the load factor exceeds a predetermined threshold.
When choosing a collision resolution strategy for a hash table, which factors are essential to consider?
Expected data distribution and load factor
Size of the keys and values being stored
Programming language and hardware architecture
All of the above
What is the purpose of dynamic resizing (rehashing) in a hashmap?
To reduce the number of keys stored in the hashmap.
To improve the efficiency of key deletion operations.
To increase the size of the hash function's output range.
To maintain a low load factor and prevent performance degradation.
What is the significance of the output size of a cryptographic hash function?
Affects the uniqueness of the hash for different inputs
Determines the speed of hash computation
Impacts the resistance against brute-force attacks
Influences the memory required to store the hash function
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
Having a hash table size much larger than the number of keys being stored
Storing keys with a wide range of values
Using a hash function that distributes keys evenly across the hash table
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 maintain data in sorted order, unlike arrays.
Hashmaps use less memory than arrays.
Hashmaps can store duplicate keys, while arrays cannot.
What is a primary disadvantage of using linear probing for collision resolution in a hash table?
Higher memory overhead compared to chaining
Increased potential for primary clustering
Not suitable for open addressing
Complex implementation
In the context of hash functions, what does the avalanche effect refer to?
Increased likelihood of hash collisions with larger datasets
A small change in input causing a significant change in output
Gradual degradation of hash performance over time
Uneven distribution of keys within the hash table
In a hash table using separate chaining for collision resolution, what is the worst-case time complexity for searching for an element?
O(n log n)
O(1)
O(log n)
O(n)