wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Y8 Search Algorithms: End of Topic Quiz

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

What is the linear search algorithm used for?

a)

Searching data

b)

Encrypting data

c)

Deleting data

d)

Sorting data

2.

What is the first step in a linear search?

a)

Examine value at counter position

b)

Find out the length of the data set

c)

Increment the counter by 1

d)

Check if the value at position matches the value searched for

3.

In a linear search, what happens if the value is found?

a)

The counter is incremented

b)

The search ends

c)

The length of the data set is checked

d)

The search continues

4.

How many of the following statements (1-4) are disadvantages of a linear search?

a)

It only works on ordered data sets

b)

It is inefficient

c)

It is not suitable for large data sets

d)

It is complex to implement

5.

Which of these statements about a linear search is TRUE?

a)

It is efficient

b)

It only works if the data is in order

c)

The data does not have to be in order

d)

It is suitable for large data sets

6.

What is the purpose of the 'counter' in a linear search?

a)

To store the value being searched for

b)

To keep track of the number of items searched

c)

To determine the length of the data set

d)

To check if the value is found

7.
A linear search is to be performed on the list:
12   6   8  1  3
How many comparisons would it take to find number 1?
a)
1
b)
2
c)
3
d)
4
8.
Describe an advantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
9.
Describe a disadvantage of a binary search algorithm
a)
Data does not need to be in order.
b)
Performs well over large ordered lists.
c)
Can only work on an ordered list.  If unordered must use a linear search.
d)
Slow with large data sets.
10.

A ​ (a)   search works effectively with ​ (b)   data sets and is ​ (c)   to program. A ​ (d)   search works effectively with ​ (e)   data sets and is more difficult to program.

Choose from the below words
linear
smaller
simple
binary
larger
11.

If a LINEAR SEARCH was used to search the data shown here, which item is in the position for the WORST CASE SCENARIO?

a)

1

b)

60

c)

88

d)

100

12.

If a LINEAR SEARCH was used to search the data shown here, which item is in the position for the BEST CASE SCENARIO?

a)

10

b)

60

c)

88

d)

100

13.

If a BINARY SEARCH was used to search the data shown here, which item is in the position for the BEST CASE SCENARIO?

a)

10

b)

57

c)

90

d)

100

14.

If a BINARY SEARCH was used to search the data shown here, select TWO items which are in the positions for the WORST CASE SCENARIO?

a)

10

b)

57

c)

90

d)

100

15.

Look at the example dataset show here. Which ONE of the following statements about this dataset, is true?

a)

Either a linear or binary search algorithm could be used with this data set

b)

A binary search algorithm could be used with this data set

c)

A linear search algorithm could be used with this data set