Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

GCSE (9–1) CS 2.1 Algorithms

Total questions: 30

Worksheet time: 9mins

Name
Class
Date
1.

Which is the correct definition for ‘algorithm’?

a)

A problem

b)

A solution to a problem

c)

A set of instructions describing the steps taken to solve a problem

d)

The words to enter when writing program code

2.

Which of the following is not a component of computational thinking

a)

Abstraction

b)

Decomposition

c)

Algorithms

d)

Pseudocode

3.

Identify the purpose of the following flowchart symbol.

a)

Input

b)

Output

c)

Start/Stop

d)

Decision

4.

Identify the purpose of the following flowchart symbol.

a)

Input/Output

b)

Sub Program

c)

Process

d)

Decision

5.

Identify the purpose of the following flowchart symbol.

a)

Process

b)

Decision

c)

Sub Program

d)

Start/Stop

6.

Identify the purpose of the following flowchart symbol.

a)

Decision

b)

Start/Stop

c)

Process

d)

Input/Output

7.

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

a)

0

b)

1

c)

2

d)

3

8.

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

a)

num1 = int(input(“Enter the first number”))

num2 – int(input(“Enter the second number”))

num3 = num1 + num2

print(num3)

b)

num1 = int(input(“Enter the first number”))

num2 = int(input(“Enter the second number”))

num2 = num1 + num2

print(num2)

c)

num1 = int(input(“Enter the first number”))

num2 = int(input(“Enter the second number”))

num3 = num1 + num2

print(num3)

d)

num1 = input(“Enter the first number”)

num2 = input(“Enter the second number”)

num3 = num1 + num2

print(num3)

9.

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

a)

number = int(input(“Enter a number”))

for x = 1 to 12

print(number * x)

next x

b)

number = int(input(“Enter a number”))

for x = 1 to 12

print(x * x)

next x

c)

number = int(input(“Enter a number”))

for x = 1 to 12

print(number x x)

next x

d)

number = int(input(“Enter a number”))

for x = 1 to 12

print(number * number)

next x

10.

Which one is a search algorithm?

a)

Random search

b)

Binary search

c)

Denary search

d)

Next item search

11.

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

12.

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

13.

Define the term computational thinking

a)

Using a computer

b)

Developing an algorithm to solve a problem

c)

Making a computer use artificial intelligence

d)

Google is computational thinking

14.

Define the term abstraction within computational thinking.

a)

Adding together numbers

b)

Taking a real world problem and designing a computer program that exactly replicates every part of that problem in the computer

c)

Performing multiple calculations on a list of variables

d)

Representing real world problems in a computer program, using symbols and removing unnecessary elements

15.

Define the term decomposition within computational thinking

a)

The breaking down of a program until it no longer exists

b)

The creation of music that can be played on a computer

c)

The breaking down of a problem into smaller problems

d)

The breaking down of waste to make compost

16.

Identify which statement describes algorithmic thinking.

a)

Thinking like a computer

b)

Writing binary numbers

c)

Identifying the steps involved in solving a problem

d)

Identifying what problems need to be solved

17.

A linear search is to be performed on the list below. How many comparisons would it take to find the number 1?

a)

1

b)

2

c)

3

d)

4

18.

A binary search is to be performed on the list below. How many comparisons would it take to find the number 9?

a)

0-1

b)

2-3

c)

3-4

d)

It won't find the number 9.

19.

A binary search is to be performed on the list below. How many comparisons would it take to the find the number 101?

a)

0-1

b)

1-2

c)

3-4

d)

4-5

20.

Identify the search performed by the following algorithm:

for x = 0 to 9

if (array[x]==10) then

print(“Found it”)

endif

next x

a)

Linear

b)

Binary

c)

Insertion

d)

Merge

21.

Which of the following is not a sorting algorithm?

a)

Bubble

b)

Insertion

c)

Binary

d)

Merge

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.

Which sorting algorithm is described by: split a list into individual lists, then combine these, two lists at a time.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of the above

24.

Which sorting algorithm is described by: take each item in turn, compare it to the items in the sorted list and place it in the ordered position in the sorted list.

a)

Merge

b)

Bubble

c)

Insertion

d)

None of the above

25.

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

a)

0

b)

1

c)

2

d)

3

26.

The following 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)
27.

Which sorting algorithm needs to go through the list repeatedly?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of them

28.

Which sorting algorithm splits a list of items into individual lists?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of them

29.

Which sorting algorithm takes an item from the list, and puts it in the correct place in a sorted list?

a)

Merge

b)

Bubble

c)

Insertion

d)

None of them

30.

A program halts and prints an error message, define this error.

a)

Logic error

b)

Maths error

c)

Syntax error

d)

Spelling error