In a symbol table implementation using a hashmap, what do the keys usually represent?
Values of variables.
Data types of variables.
Memory addresses of variables.
Names of variables or identifiers.
Why are hash functions typically designed to be fast to compute?
To minimize memory usage.
To ensure efficient insertion, deletion, and search operations.
To prevent data loss during collisions.
To maintain the sorted order of keys.
What is a disadvantage of using hashmaps when the number of elements to be stored is not known in advance?
They might require resizing, which can be an expensive operation.
They are more complex to implement than linked lists.
They are less memory-efficient than arrays for storing a fixed number of elements.
They are not suitable for storing data in a sorted order.
In hashmap terminology, what does 'collision' refer to?
When two keys map to the same index in the hashmap.
When trying to delete a key that doesn't exist.
When two hashmaps have the same size.
When a hash function produces the same output for all inputs.
Which of these is NOT a desirable property of a good hash function?
It should minimize collisions as much as possible.
It should be computationally expensive to calculate.
It should distribute keys uniformly across the hash table.
It should be deterministic (same input always yields the same output).
Why is a good hash function important for hashmap performance?
To ensure that keys are evenly distributed across the hash table, reducing collisions.
To minimize the number of comparisons required to find an element.
To allow for efficient resizing of the hash table.
To reduce the memory used by the hash table.
Which characteristic of a hash function is undesirable and can lead to performance degradation?
High Collision Rate
Deterministic
Fast Computation
Uniform Distribution
How are dictionaries typically implemented in programming languages?
Using linked lists for fast insertions.
Using arrays for efficient indexing.
Using binary trees for sorted key storage.
Using hashmaps to provide fast key-value lookups.
Which of the following is NOT a typical operation supported by hashmaps?
Search
Delete
Sort
Insert
What is the primary advantage of using a hashmap over a linear search in an array when searching for a specific value?
Hashmaps can handle duplicate values more efficiently.
Hashmaps use less memory.
Hashmaps offer faster search times on average.
Hashmaps can store sorted data.