A simple hash function for strings could involve summing the ASCII values of each character in the string. What is a potential drawback of this approach?
It's computationally expensive.
It's not reversible, meaning you can't get the original string from the hash.
It can't handle strings of varying lengths.
It can lead to a high number of collisions for anagrams.
Which of the following is NOT a collision handling technique in hashmaps?
Open Addressing
Separate Chaining
Binary Search
Linear Probing
How are dictionaries typically implemented in programming languages?
Using binary trees for sorted key storage.
Using arrays for efficient indexing.
Using linked lists for fast insertions.
Using hashmaps to provide fast key-value lookups.
Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Deletion
Search
Insertion
All of the above
What is linear probing in the context of open addressing for collision resolution?
Resizing the hash table to accommodate more elements.
Probing for an empty slot by sequentially searching from the collision index.
Using a linked list to store colliding elements at the same index.
Using a different hash function to avoid collisions.
Which of these data structures is commonly used to handle collisions in hashmaps?
Queue
Binary Tree
Heap
Linked List
In hashmap terminology, what does 'collision' refer to?
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.
When two keys map to the same index in the hashmap.
Which of these is a disadvantage of open addressing compared to separate chaining in hashmaps?
Requires more complex implementation compared to chaining.
Cannot handle a large number of collisions efficiently.
Clustering of elements can lead to performance degradation.
Increased memory usage due to linked lists.
Which of the following is NOT a typical operation supported by hashmaps?
Sort
Delete
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 store sorted data.
Hashmaps can handle duplicate values more efficiently.
Hashmaps use less memory.
Hashmaps offer faster search times on average.