Lesson 4.2.6.1
4.2.6.1 Hash tables, hashing and collisions Quiz: AQA Computer Science, Unit 2
20 questions
In partnership with Revision Ninja
Lesson 4.2.6.1, Hash tables, hashing and collisions: 20 multiple choice questions for the AQA Computer Science (7517), Unit 2: Fundamentals of data structures, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
Which data structure creates a direct mapping between key values and stored values?
- Binary tree
- Hash table
- Queue
- Priority queue
-
What converts a key into a specific storage index in a hash table?
- Index pointer
- Hash function
- Key mapper
- Search algorithm
-
What occurs when a hash function generates the same index for two different keys?
- Underflow
- Deadlock
- Collision
- Overflow
-
Which process finds an alternative slot in a hash table when a collision occurs?
- Sorting
- Indexing
- Truncating
- Rehashing
-
A hash function is key MOD 7 and the table has 7 slots (0 to 6). Where is the key 23 stored?
- Slot 3
- Slot 5
- Slot 2
- Slot 0
-
Using the hash function key MOD 7, to which slot index does the key 17 hash?
- 4
- 3
- 2
- 1
-
A hash table of 10 slots uses key MOD 10. Which slot does the key 47 use?
- 47
- 0
- 4
- 7
-
A hash table has 11 slots and uses key MOD 11. Which key below would hash to slot 0?
- 13
- 9
- 23
- 22
-
What is the primary purpose of spreading keys evenly across a hash table?
- Eliminate pointers
- Sort key values
- Reduce memory size
- Minimise collisions
-
Which hash table operation executes in O(1) average time when collisions are minimal?
- Sorting keys
- Finding minimum
- Key lookup
- Full traversal
-
Which collision resolution method checks consecutive slots sequentially until an empty slot is found?
- Binary search
- Chaining traversal
- Depth-first search
- Linear probing
-
Using linear probing with step 1, where is a key hashing to occupied slot 4 placed?
- Slot 0
- Slot 6
- Slot 3
- Slot 5
-
Which property ensures a hash function distributes keys uniformly across all available slots?
- Sequential ordering
- Inverted indexing
- Uniform distribution
- Reversible mapping
-
Which data structure is most commonly used to implement an abstract dictionary data type?
- Queue
- Stack
- Hash table
- Linked list
-
Which slot do keys 5, 13, and 21 all hash to using the calculation key MOD 8?
- Slot 0
- Slot 7
- Slot 3
- Slot 5
-
What component maps a key to a valid storage index within a hash table?
- Hash function
- Index vector
- Search tree
- Pointer array
-
Which index do keys 12 and 27 both compute using the hashing algorithm key MOD 5?
- Index 2
- Index 5
- Index 0
- Index 1
-
What is a key disadvantage of a hash table compared with a sorted array?
- Higher time complexity
- Greater memory usage
- Unordered data
- Slower searching
-
What is the best way to resolve frequent collisions in a nearly full hash table?
- Truncate all keys
- Clear the table
- Resize and rehash
- Sort the table
-
Which mathematical operation is most commonly used in simple hashing algorithms?
- Square root
- Logarithm
- Modulo
- Factorial
Related quizzes
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Single- and multi-dimensional arrays Quiz · 4.2.1.2 · 20 questions
- Reading and writing text and binary files Quiz · 4.2.1.3 · 20 questions
- Linear, circular and priority queues Quiz · 4.2.2.1 · 20 questions
- Stack operations Quiz · 4.2.3.1 · 20 questions
- Graphs: weighted, directed and adjacency representations Quiz · 4.2.4.1 · 20 questions
- Trees and binary trees Quiz · 4.2.5.1 · 20 questions
- Dictionaries and key-value pairs Quiz · 4.2.7.1 · 20 questions
- Vectors and vector operations Quiz · 4.2.8.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions