wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Hash Tables Quiz

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is the goal of a hash table?

a)

To compare items in a data set

b)

To store all the data items

c)

To immediately find an item without comparing other items

d)

To implement a dictionary data structure

2.

What is a hashing function used for?

a)

To calculate the position of an item in a hash table

b)

To determine the size of a hash table

c)

To compare items in a data set

d)

To implement a dictionary data structure

3.

What is a collision in a hash table?

a)

When two data items have the same hash value

b)

When a hash table is too small to store all the data items

c)

When a hashing function takes too long to calculate

d)

When a hash table is empty

4.

What is a disadvantage of linear probing?

a)

It prevents other items from being stored in their correct location

b)

It requires a large amount of memory

c)

It results in a high number of collisions

d)

It is a slow method of resolving collisions

5.

What is rehashing in a hash table?

a)

Finding an alternative position for items in the hash table

b)

Using a two-dimensional hash table

c)

Storing items in a linked list

d)

Searching sequentially in an overflow table

6.

What is chaining in a hash table?

a)

Storing items in a linked list

b)

Using a two-dimensional hash table

c)

Searching sequentially in an overflow table

d)

Finding an alternative position for items in the hash table

7.

What is the typical use of a hash table?

a)

Linking a file name to the file path

b)

Sorting a large dataset

c)

Performing calculations on a data set

d)

Creating a dictionary data structure

8.

What are the three basic operations that can be performed on a hash table?

a)

Adding a value, deleting a value, retrieving a value

b)

Sorting a value, searching a value, updating a value

c)

Copying a value, moving a value, renaming a value

d)

Creating a value, reading a value, updating a value

9.

What is the purpose of the book 'Essential Algorithms for A Level Computer Science'?

a)

To cover all the data structures and algorithms needed for A Level Computer Science

b)

To provide additional resources for understanding data structures

c)

To teach programming languages and their syntax

d)

To explain the concept of hashing functions

10.

What is the advantage of using a larger hash table?

a)

It reduces the chance of collisions

b)

It speeds up the hashing function

c)

It allows for more efficient linear probing

d)

It minimizes the memory footprint

11.

What is the disadvantage of using a smaller hash table?

a)

It increases the chance of collisions

b)

It slows down the hashing function

c)

It requires more memory

d)

It prevents linear probing

12.

What is the purpose of a two-dimensional hash table?

a)

To store multiple items at the same position

b)

To prevent collisions in a hash table

c)

To speed up the hashing function

d)

To reduce the memory footprint

13.

What is the purpose of an overflow table in a hash table?

a)

To store items that cannot be placed in the hash table

b)

To prevent collisions in a hash table

c)

To speed up the hashing function

d)

To reduce the memory footprint

14.

What is the purpose of a linked list in a hash table?

a)

To store items that cannot be placed in the hash table

b)

To prevent collisions in a hash table

c)

To speed up the hashing function

d)

To reduce the memory footprint

15.

What are hash tables commonly used for?

a)

Linking file names to file paths

b)

Sorting large datasets

c)

Performing calculations on data sets

d)

Creating dictionary data structures