What is a primary disadvantage of using linear probing for collision resolution in a hash table?
Increased potential for primary clustering
Complex implementation
Not suitable for open addressing
Higher memory overhead compared to chaining
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.
Which collision resolution strategy is generally preferred for hash tables with open addressing when the load factor is low?
Separate Chaining
Quadratic Probing
Double Hashing
Linear Probing
Which of the following scenarios could potentially lead to collisions in a hashmap?
Using a hash function that distributes keys evenly across the hash table
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
You need to count the frequency of each word in a large text document. Which combination of data structures would be most efficient for this task?
A binary tree where words are stored in the nodes and their frequencies are stored in the leaves
Two arrays: one for storing words and one for storing their frequencies
A hashmap where words are keys and their frequencies are values
A sorted linked list where each node contains a word and its frequency
Which collision resolution technique involves using a second, independent hash function to compute the probe sequence?
What is the primary motivation behind designing hash functions with a uniform distribution property?
To maximize the amount of data that can be stored in the hash table
To simplify the implementation of the hash function itself
To reduce the memory footprint of the hash table
To minimize the occurrence of hash collisions and improve efficiency
How does an increasing load factor generally impact the performance of a hashmap?
It has no significant impact on performance.
It degrades performance due to a higher probability of collisions.
It depends on the specific hash function being used.
It improves performance by reducing memory usage.
In a hash table using open addressing with quadratic probing, if the initial hash function maps a key to index 'i', and a collision occurs, what is the index probed in the second attempt (assuming table size 'm')?
(i * 2) % m
(i + 1) % m
(i + 2) % m
(i + 4) % m
In the context of hashmaps, what does 'probing' refer to?
Searching for a specific key in the hashmap.
Finding an alternative slot for a key when a collision occurs.
Determining the load factor of the hashmap.
Resizing the underlying array to accommodate more keys.