How are dictionaries typically implemented in programming languages?
Using hashmaps to provide fast key-value lookups.
Using binary trees for sorted key storage.
Using arrays for efficient indexing.
Using linked lists for fast insertions.
What is a significant disadvantage of using a hashmap when you need to retrieve elements in a sorted order?
Hashmaps have high memory consumption.
Hashmaps cannot handle duplicate values.
Hashmaps have slow insertion times.
Hashmaps don't inherently maintain order.
Which of these is a disadvantage of open addressing compared to separate chaining in hashmaps?
Increased memory usage due to linked lists.
Clustering of elements can lead to performance degradation.
Requires more complex implementation compared to chaining.
Cannot handle a large number of collisions efficiently.
Which of the following operations typically has a time complexity of O(n) in the worst case for a hashmap?
Insertion
Search
Deletion
All of the above
Which of these is NOT a desirable property of a good hash function?
It should be computationally expensive to calculate.
It should minimize collisions as much as possible.
It should be deterministic (same input always yields the same output).
It should distribute keys uniformly across the hash table.
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.
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 not reversible, meaning you can't get the original string from the hash.
It's computationally expensive.
It can't handle strings of varying lengths.
It can lead to a high number of collisions for anagrams.
In a symbol table implementation using a hashmap, what do the keys usually represent?
Names of variables or identifiers.
Memory addresses of variables.
Data types of variables.
Values of variables.
What is linear probing in the context of open addressing for collision resolution?
Using a linked list to store colliding elements at the same index.
Probing for an empty slot by sequentially searching from the collision index.
Resizing the hash table to accommodate more elements.
Using a different hash function to avoid collisions.
Which of these data structures is commonly used to handle collisions in hashmaps?
Heap
Queue
Linked List
Binary Tree