Algorithmic Thinking Assessment
Algorithmic Thinking Assessment
Name:
Resources
PG Online text book page ref: 2-23
CraignDave videos for SLR 8
GCSE Paper 1 | SLR8 |Algorithms
What's an algorithm?
An algorithm is:
2. Eat breakfast
3. Brush teeth
4. Have a shower
5. Get dressed
6. Check school bag has correct books and homework for the day
7. Pack lunchbox
Abstraction
Abstraction means:
Example of an abstraction:
Abstraction
Cat: Cat icon: Necessary features of the icon: Unnecessary features of the icon:
Dog: Dog icon: Necessary features of the icon: Unnecessary features of the icon:
Rabbit: Rabbit icon: Necessary features of the icon: Unnecessary features of the icon:
GCSE Paper 1 | SLR8 |Algorithms
Abstraction
A computer program that outputs whether a capital city in Europe is north or south of another capital city in Europe only needs to know the latitude of the two
cities. The other detail is unnecessary. This is an example of abstraction: including the necessary detail and not including the unnecessary detail.
Dublin 53.3498
London 51.5074
Oslo 59.9139
Paris 48.8566
Madrid 40.4168
Program:
GCSE Paper 1 | SLR8 |Algorithms
Decomposition
Decomposition means:
Decomposition
Red beads
Chain
Purple beads
GCSE Paper 1 | SLR8 |Algorithms
Program:
GCSE Paper 1 | SLR8 |Algorithms
Line
GCSE Paper 1 | SLR8 |Algorithms
1. Play game
2. Change character
3. Quit
Module Module1
Sub Main()
Dim counter1, counter2 As Integer
For counter1 = 1 To 5
For counter2 = 1 To 3
Console.Write("O")
Next
Console.WriteLine()
Next
Console.ReadLine()
End Sub
End Module
GCSE Paper 1 | SLR8 |Algorithms
Module whatIsThis
Sub Main()
Dim n As Integer
n = Console.ReadLine()
Console.WriteLine()
While (n > 0)
If (n Mod 2 = 0) Then
Console.WriteLine("0")
Else
Console.WriteLine("1")
End If
n = n \ 2
End While
Console.WriteLine("Read bottom up!")
Console.ReadLine()
End Sub
End Module
GCSE Paper 1 | SLR8 |Algorithms
Module whatsThis
Sub Main()
Dim x, y, total, counter As Integer
x = Console.ReadLine()
y = Console.ReadLine()
total = x
For counter = 1 To y - 1
total = total * x
Next
Console.WriteLine(total)
Console.ReadLine()
End Sub
End Module
GCSE Paper 1 | SLR8 |Algorithms
Linear search
Binary search
In most cases, the quicker search is performed by the: algorithm. However, this is not true if the first item in the list is the one you want to find.
If the item you want to find is first in the list then the algorithm would be quicker.
GCSE Paper 1 | SLR8 |Algorithms
Binary search
Merge sort
82
43
27
38
Original list. Split list until Swap number Merge adjacent Until all lists are
lists have 2 pairs if lists together. merged.
numbers. necessary.
GCSE Paper 1 | SLR8 |Algorithms
Merge sort
24
16
32
Original Split into Swap numbers Merge adjacent lists together Merge adjacent lists together
list. adjacent sub- if necessary in by comparing the first number by comparing the first number
lists of up to two each sub list. in each list, moving the in each list, moving the
numbers. 8 and 16 swap. smaller number into a new smaller number into a new
list, one number at a time. list, one number at a time.
GCSE Paper 1 | SLR8 |Algorithms
Bubble sort
How a bubble sort works: Note how 32 has “bubbled” to the top. The algorithm has been optimised so it does not check the
This is how the bubble sort got its name. numbers already bubbled to the top. It can also stop if no
swaps are made after all the numbers are checked.
24 32
8 24
16 16
2 8
32 2
Check 2 Check 32 Check 32 Check 32 Check 2 Check 16 Check 16 Check 2 Check 8 Check 2
and 32. and 16. and 8. and 24. and 16. and 8. and 24. and 8. and 16. and 8.
Swap Swap. Swap. Swap. No swap. Swap. No swap. No swap. No swap. No swap.
GCSE Paper 1 | SLR8 |Algorithms
In both cases, searching and sorting, either algorithm can used to solve the problem, but most situations one would be more efficient (quicker) than the other.
Feedback
Breadth Depth Understanding
Some aspects complete Basic level of depth shown Some work is accurate
Little work complete Little depth and detail provided Little work is accurate
I can explain simple algorithms in terms of their inputs, processing and outputs
I can use trace tables and visual inspections to determined how simple algorithms work and what their purpose is.
I can explain that more than one algorithm can be used to solve the same problem.
I can explain how some algorithms are more efficient than others in solving the same problem.
I can compare and contrast the linear and binary search algorithms.
I can compare and contrast the merge sort and bubble sort algorithms.
My revision focus will need to be: