0% found this document useful (0 votes)
37 views

GCSE Computer Science End of TopicTests - Algorithms.199788941

Uploaded by

chrischitate3
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

GCSE Computer Science End of TopicTests - Algorithms.199788941

Uploaded by

chrischitate3
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

GCSE Computer

GCSE Computer Science (9-1) Science (9-1)


Algorithms - Topic Test

Algorithms

Topic Tests

Photocopiable Resources
Edulito©2017 Page 1
GCSE Computer Science (9-1) Algorithms - Topic Test

Terms and Conditions of Use


Your school has permission to copy this resource as many times as you require and to use it as
you wish within your school/organisation.

You do not have permission to distribute it as a paper or electronic document to other schools
or organisations.

Any questions? Email: [email protected]


© 2016 Edulito and its licensors. All rights reserved.

Edulito©2017 Page 2
GCSE Computer Science (9-1) Algorithms - Topic Test

Topic Test 2.1 Algorithms


1 (a) Match each word to the correct definition. [4]
1 A This involves filtering out (or
ignoring) the characteristics
Algorithm that we don't need in order to
concentrate on those that we
do.

2 B It involves breaking down a


complex problem or system
Decompose into smaller parts that are
more manageable and easier
to understand.

3 C This is a list of rules to follow


Pattern Recognition in order to solve a problem.
The steps need to be in the
right order.

4 D Once we have broken down


a complex problem, it helps to
examine the small problems
Abstraction for similarities. These
similarities can help us to solve
complex problems more
efficiently.

(b) What is meant by the term Algorithmic Thinking? [2]

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

(c) Why is algorithmic thinking used in programming? [1]

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………
Edulito©2017 Page 3
GCSE Computer Science (9-1) Algorithms - Topic Test

2. (a) Use the list of words to complete this document. [7]


faster linear number match splits tries binary

A ……………………………….. search starts at the beginning of the sequence of information and


tries to find a………………………………. Once it has found a match it stops.

Another type of search is called a …………………………… search. This type of search


………………………………… the parts of the list being searched into two with each check. This
makes it …………………………………than a linear search. For example, if you were playing a
number guessing game and had to guess a ………………………….. between 1 and 10, it would
not take more than 3 ……………………………, if you always choose the middle number each time
and you were told whether the number was higher or lower.

2 (b) This is an example of a binary search. It can be used to search for a particular student
name. Complete the algorithm by adding T for True and F for FALSE to the empty boxes. [6]

Edulito©2017 Page 4
GCSE Computer Science (9-1) Algorithms - Topic Test

2 (c) What is a linear search? [3]


………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

2 (d) Using pseudocode or a flow chart, write an algorithm for a linear search in the space

provided below. [4]

Edulito©2017 Page 5
GCSE Computer Science (9-1) Algorithms - Topic Test

3 There are some gaps in the bubble sort below. Complete the gaps using the words
shown. [6]

stop next swap last repeat first

1. Look at the ……………………………………….. number in the list.

2. Compare the current number with the next number.

3. Is the next number smaller than the current number? If so,

……………………………………….the two numbers around. If not, do not swap.

4. Move to the ………………………………………. number along in the list and make this the

current number.

5. Repeat from step 2 until the ………………………………………. number in the list has been

reached.

6. If any numbers were swapped, ………………………………………. again from step 1.

7. If the end of the list is reached without any swaps being made, then the list is

ordered and the algorithm can ………………………………………..

4 (a) Explain the meaning of merge sort. [3]

…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

(b) Give an advantage and a disadvantage of merge sort over a bubble or insertion sort.
[2]
Advantage…………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

Disadvantage……………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

Edulito©2017 Page 6
GCSE Computer Science (9-1) Algorithms - Topic Test

5 (a) What is an insertion sort algorithm? [2]


…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

…………………………………………………………………………………………………………………………………………

(b) Is the insertion sort quicker or slower than the bubble sort? [1]

…………………………………………………………………………………………………………………………………………

6. (a) Use pseudocode to create to produce an algorithm that asks for the length of a
rectangle and the width of a rectangle. The algorithm then calculates the area of the
square and displays a message “the area of the square is” and displays the area of the
square. Include comments to explain what each line of code does. [8]

Edulito©2017 Page 7
GCSE Computer Science (9-1) Algorithms - Topic Test

6(b) Use pseudocode to produce an algorithm that asks the person to enter a number
between 1 and 20. If the number is greater or equal to 10 then display a message “The
number is equal or higher than 10”. However, if the number is less than 10 it should
display the message “The number is less than 10”. [5]

7 (a) Produce a flow chart that shows an algorithm for making a cup of tea. It should include:
Sequence; Selection, Iteration. [5]

Edulito©2017 Page 8
GCSE Computer Science (9-1) Algorithms - Topic Test

7(b) Produce a flow chart that inputs a random number and inputs the number that you
want to guess. The flowchart then compares the number you have guessed with the random
number and if they are the same you get a message to say “Correct”, but if you guess
incorrectly the algorithm uses an indefinite loop to allow the person to keep on guessing
until they get the number right. [5]

7(c) If you wanted to give the person no more than three guesses, what would you need to
add to the flowchart? [3]

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

………………………………………………………………………………………………………………………………………………

Edulito©2017 Page 9
GCSE Computer Science (9-1) Algorithms - Topic Test

Topic Test - Algorithms - Mark Scheme


Question Answer Additional Mark
Number Guidance

1a 1-C; 2-B; 3-D; 4-A 4


1b Algorithmic thinking is a way of finding a solution to a problem [1] 2
through the clear definition of the steps needed.[1]

1c It is possible to use algorithmic thinking to: Max 1 1


 produce solutions that can be automated [1]
 remove the need for human intervention. [1]

2a A linear search starts at the beginning of the sequence of information 7


and tries to find a match. Once it has found a match it stops.
Another type of search is called a binary search. This type of search
splits the parts of the list being searched into two with each check.
This makes it faster than a linear search. For example, if you were
playing a number guessing game and had to guess a number between
1 and 10, it would not take more than 3 tries, if you always choose the
middle number each time and you were told whether the number was
higher or lower.
2b 6

2c A linear search is a sequential search. [1] 3


It starts at the beginning of the list and moves through the
items one by one [1], until it finds a matching value or reaches
the end without finding one [1].

Edulito©2017 Page 10
GCSE Computer Science (9-1) Algorithms - Topic Test

2d Algorithm includes: 4
Selection:
Compare item with the data you are looking for [1]
If they are the same then stop [1]
If they are not the same move on to next item [1]
Loop: Repeat steps above [1]

3 1 first 1 mark for each 7


3 swap correct answer
4 next
5 last
6 repeat
7 stop

4a The merge sort repeatedly divides [1] 1 mark for 3


a list into two smaller lists [1] divide and
until the size of the list becomes one [1] conquer
The individual lists are then merged.[1] algorithm.
Max 3 marks

4b Advantage – more efficient [1] and faster [1] than bubble or insertion 2
sort. Max 1
Disadvantage – complex to code [1]

5a Examines each item in turn [1] 2


Inserts it in the correct position within the list. [1]

5b Quicker [1] 1
6a length = input (“Please enter the length”)[1] //Ask the user for the Any appropriate 8
length of the rectangle. [1] comment
width = input (“Please enter the width”)[1] //Ask the user for the accepted
width of the rectangle. [1]
area = length * width [1] //Find the area by multiplying the length by
the width. [1]
print (“The area of the square is: “+ area)[1] //output the area. [1]

6b number=input(“Enter a number between 1 and 20”)[1] Allow answer 5


if number >=10 then [1] using structured
print (“The number is equal or higher than 10”) [1] English
else: [1]
print (“The number is less than 10”) [1]

7a Appropriate use of a sequence. [1] 5


Appropriate use of selection:
Appropriate condition [1]
If true [1]
If false [1]
Loop [1]
e.g.

Edulito©2017 Page 11
GCSE Computer Science (9-1) Algorithms - Topic Test

7b Appropriate use of a sequence. [1] 5


Appropriate use of selection:
Appropriate condition [1]
If true [1]
If false [1]
Loop [1]
e.g.

7c Variable – that records the number of guesses. [1] 3


A new condition (selection) to see whether three guesses had been
reached. [1] /68
A process box that increments eg count=count+1. [1]

Edulito©2017 Page 12

You might also like