wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

2.1 Linear Search

Total questions: 20

Worksheet time: 17mins

Name
Class
Date
1.
Which type of lists or data sets are linear searching algorithms used for?
a)
Unsorted lists or data sets
b)
Sorted lists or data sets
2.
What does a search algorithm do?
a)
Save data in a list
b)
Sort data in a list
c)
Write data to a list
d)
Search data in a list
3.
Which of the following descriptions best describes a linear search:
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare with the middle value, split the list in order and repeat
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat.
4.
A Linear search algorithm requires data to be ordered.
a)
True
b)
False
5.
A linear search is to be performed on the list:
12, 6, 8, 1, 3
How many searches would it take to find the number 1?
a)
1
b)
2
c)
3
d)
4
6.
How many linear searches will it take to find the value 7 in the list [1,4,8,7,10,28]?
a)
2
b)
3
c)
4
d)
5
7.
What is a trace table?
a)
A technique used to test algorithms for logical errors.
b)
A technique used for drawing in art.
c)
A type of sort algorithm
d)
A type of search algorithm
8.
What is pseudocode?
a)
Another way to write an algorithm. It is like 'fake' code.
b)
Uses symbols to represent an algorithm
9.
What will happen in a Linear search algorithm if no match is found?
a)
It continues to search in a never ending loop.
b)
"Item not found" is returned
10.
What is a disadvantage of the Linear search algorithm?
a)
It will only work on a sorted data set
b)
May be too slow to process large data sets
11.
What is an advantage of the Linear search algorithm?
a)
Performs well with small sized data sets
b)
Can be used on data sets with more than a million elements
c)
Is complicated to code
12.
What is an Algorithm?
a)
A chart showing the flow of a series of events
b)
Step-by-step instructions used to solve a problem
c)
A decision arrived at by following instructions
d)
A computer program that follows a chart
13.

Instructions carried out one after another in order is a...

a)

List

b)

Sequence

c)

Collection

d)

Series

14.
What is pseudocode?
a)
Simplified programming language, that is not a specific language
b)
Complicated programming language
c)
Simple programming language, which is linked to a specific language
d)
A type of cheese
15.

Which symbol is Input/Output?

a)
b)
c)
d)
16.

What does this symbol represent?

a)

Input/Output

b)

Decision

c)

Off-Page Connector

d)

Process

17.

What is the best case scenario in a linear search?

a)

The item being searched for is at the end of the list

b)

The item being searched for is at the start of the list

c)

The item is not present in the list

d)

The item being searched for is exactly in the middle of the list

18.

Which algorithm?

Starts at the begining and compares each item in turn until the target is found.

a)

Bubble sort

b)

Merge sort

c)

Linear search

d)

Binary search

19.

Look at the Algorithm Below. In the corresponding Trace Table, what value should 'A' be?

a)

1

b)

3

c)

5

d)

7

20.

The trace table will contain two columns: (a)   and Output.