wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Algotihms

Total questions: 23

Worksheet time: 17mins

Name
Class
Date
1.
What command is this shape for?
a)
START / STOP
b)
INPUT / OUTPUT
c)
PROCESS
d)
DECISION
2.
What does this shape represent?
a)
Input/Output
b)
Decision
c)
Process
d)
Start/Stop
3.
What does this shape represent?
a)
Decission
b)
Process
c)
Input/Output
d)
Start/End
4.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
5.
What command is this shape for?
a)
References another part of the program
b)
Data that is going in as input or coming out as output
c)
Processing something - a calculation or storing something into a variable
d)
Shows the direction of the program
6.
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
7.
Assume n1 = 10 ... n2 = 2 ... n3 = 2
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
8.
Assume n1 = 10 ... n2 = 20
What will be displayed as output?
a)
10
b)
20
9.
What is the correct definition of an algorithm?
a)
An algorithm is a step by step instructions to solve a problem.
b)
An algorithm is a process of baking bread.
c)
An algorithm is a software used to compute numbers.
d)
An algorithm is the process of breaking problems.
10.
What is the difference between a flowchart and pseudocode? 
a)
A flowchart is diagramatic whilst pseudocode is written in a programming language (eg. Pascal or Java) 
b)
A flowchart is textual but pseudocode is diagrammatic 
c)
A flowchart is a diagrammatic description of an algorithm whilst pseudocode is a textual description of an algorithm 
d)
A flowchart and pseudocode are the same thing 
11.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
12.
What does this symbol mean?
<
a)
Greater Than
b)
Less Than
13.
What is this ?
a)
Pseudocode
b)
Flow chart
c)
Syntax
14.
An identifier is the ‘name’ given to a variable. For example: 
distanceToSchool = 10
What is the value of the variable?
a)
10
b)
=
c)
distanceToSchool
15.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
16.
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
17.
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
18.
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
19.
Where can Linear Search be performed?
a)
On letters
b)
On numbers
c)
Both
d)
None of these
20.
Which of the following is the best description of the linear search algorithm?
a)
Put the elements in order, then go through them one by one until target is found or the end of the list is reached.
b)
Put the elements in order, compare with the middle value, if not the target: continue to the left or right of the middle and repeat. 
c)
Elements do not need to be in order. Go through them one by one until target is found or the end of the list is reached.
d)
Elements do not need to be in order, compare with the middle value, if not the target: continue to the left or right of the middle and repeat. 
21.
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
22.

Which loop is used to move through the array elements in a linear search?

a)

"for" loop

b)

"while" loop

c)

"repeat until" loop

d)

"do" loop

23.

What is the output of the following piece of code (assume that the code is indented properly):

num = arr.array('i', [1, 3, 5, 7, 9])

for i in range(len(num)):

if num[i] == 5:

print(i)

a)

2

b)

3

c)

5

d)

returns an error