wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

WJEC 2.2 Algorithms and Programming Constructs - Algorithms

Total questions: 38

Worksheet time: 23mins

Name
Class
Date
1.
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.
2.
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 
3.
What command is this shape for?
a)
START / STOP
b)
INPUT / OUTPUT
c)
PROCESS
d)
DECISION
4.
What does this shape represent?
a)
Input/Output
b)
Decision
c)
Process
d)
Start/Stop
5.
What does this shape represent?
a)
Decission
b)
Process
c)
Input/Output
d)
Start/End
6.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
7.
What will be displayed as output?
a)
10
b)
20
c)
30
d)
40
8.
What is the Output if the user enters:
Yes
a)
Leave umbrella at home
b)
Take an umbrella
9.
Which of the following assignment statements is assigning text.
a)
myName = "David"
b)
myAge = 21
10.
What is this symbol?
a)
Decision
b)
Input/Output
c)
Start/End
d)
Process
11.

How many arrows should come out of a decision symbol in a flowchart?

a)

0

b)

1

c)

2

d)

3

12.

The following algorithm should take as input and add together two numbers, outputting the result.


Identify the correct algorithm.

a)
b)
c)
d)
13.

The following algorithm should take as input on number, and output the 12 times table for that number.


Identify the correct algorithm.

a)
b)
c)
d)
14.

The following algorithm should take as input two numbers, add them together, multiply the answer by 11, add 4, then divide by 2. It should output the result.


Identify the correct algorithm.

a)
b)
c)
d)
15.
When you write an algorithm the order of the instructions is very important.
a)
True
b)
False
16.

What are the three algorithm constructs?

a)

Sequence, Selection, Iteration

b)

Input, Process, Output

c)

Input/output, decision, terminator

d)

Loop, input/output, process

17.
Identify the description of a binary search
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare to 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
18.
Identify the description of a linear search
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare to 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
19.

A linear search is to be performed on the list above.

How many comparisons would it take to find the number 1?

a)

1

b)

2

c)

3

d)

4

20.

A binary search is to be performed on the list above.

How many comparisons would it take to find the number 9?

a)

0-1

b)

2-3

c)

4-5

d)

It can't find the number 9

21.

A binary search is to be performed on the list above.

How many comparisons would it take to the find the number 101?

a)

0-1

b)

1-2

c)

3-4

d)

4-5

22.
Which sorting algorithm is described by: moving through a list repeatedly, swapping elements that are in the wrong order.
a)
Merge
b)
Bubble
c)
Insertion
d)
None of the above
23.

The above list is to be sorted using a bubble sort.

What will the list look like after the first iteration through the list.

a)
b)
c)
d)
24.

The two lists above are to be merged, which element first goes into the new merged list

a)

0

b)

1

c)

2

d)

3

25.
On average, which searching algorithm is more efficient?
a)
Binary Search
b)
Linear Search
26.
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. 
27.
As the data set grows in size, linear search becomes more efficient than binary search. 
a)
True
b)
False
28.
What is the maximum number of comparisons a linear search algorithm could make while searching a 100 item list?
a)
50
b)
51
c)
100
d)
101
29.
Which type of sort algorithm is this?
a)
Bubble
b)
Merge
c)
Insertion
30.
Which type of sort algorithm is this?
a)
Bubble
b)
Merge
c)
Insertion
31.
A binary search algorithm will only work on a list which is in order. True or False
a)
True
b)
False
32.
Which one of the following is an advantage of a linear search?
a)
It takes a long time to find the item.
b)
It is a simple algorithm to write.
c)
It is more efficient than a binary search.
d)
It is a complex algorithm to write.
33.
Which type of search algorithm is this?
a)
Binary
b)
Linear
34.
Which type of search algorithm is this?
a)
Binary
b)
Linear
35.
What is the biggest disadvantage of a binary search?
a)
It is slow
b)
It can only be used if the data is sorted into an order
c)
It takes the data and keeps dividing it in half until it finds the item it is looking for
36.
Using a binary search why will the number 9 never be found in the following list:
11, 8, 13, 9, 7, 3
a)
It does not work on numbers
b)
It only works on letters
c)
The list is not in order
37.

Which algorithm uses a divide and conquer approach?

a)

Linear Search

b)

Binary Search

38.
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