Which of the following is NOT a typical operation supported by hashmaps?
Insert
Sort
Delete
Search
You want to update the value associated with a key in a hashmap. What is the general process involved?
Calculate the hash of the key, find the corresponding bucket, and directly modify the value.
Delete the existing key-value pair, then insert a new one with the updated value.
Search for the key sequentially, and update the value when found.
Hashmaps do not support value updates; you need to create a new hashmap.
Which of the following data structures is commonly used to implement a hashmap?
Linked List
Tree
Array
Graph
Why are hash functions typically designed to be fast to compute?
To ensure efficient insertion, deletion, and search operations.
To minimize memory usage.
To maintain the sorted order of keys.
To prevent data loss during collisions.
What is the primary role of the modulo operator (%) in simple hash functions?
To generate a unique hash code for each key.
To handle collisions effectively.
To sort keys in ascending order based on their hash values.
To map the hash code to a valid index within the array's bounds.
Which collision resolution technique is commonly used in hashmaps?
Merge Sort
Bubble Sort
Separate Chaining
Binary Search
In a symbol table implementation using a hashmap, what do the keys usually represent?
Names of variables or identifiers.
Data types of variables.
Memory addresses of variables.
Values of variables.
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 offer faster search times on average.
Hashmaps can store sorted data.
Hashmaps use less memory.
Which characteristic of a hash function is undesirable and can lead to performance degradation?
Deterministic
Uniform Distribution
High Collision Rate
Fast Computation
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).