What is abstraction?
Removing unnecessary details to focus on what’s important in solving a problem.
What is decomposition?
Breaking a problem into smaller more manageable sub-problems, each achieving a specific task.
What is algorithmic thinking?
The ability to create a set of instructions to find the solution to a problem.
What is pattern recognition?
The process of identifying similarities or recurring features in problems and solutions.
What is an algorithm?
A sequence of steps that can be followed to complete a task.
What are three common ways to represent algorithms?
Pseudocode, program code (e.g. Python), and flowcharts.
What is a flowchart?
A diagram which uses symbols to represent the steps and decision-making processes of an algorithm.
What should you always do in an exam question about algorithms?
Use the required format (e.g. code to be written in pseudocode or program code, flowcharts if asked).
What are the three stages of an algorithm?
Inputs, processing, and outputs.
How can you determine the purpose of a simple algorithm?
By using trace tables or visually inspecting the algorithm.
What is a trace table?
A tool to track the values of variables step by step as an algorithm runs.
What is a syntax error?
An error which breaks the rules of the programming language, meaning the program will not run, e.g. missing colon in Python.
What is a logic error?
An error which causes a program to produce the wrong result; a program with a logic error will still run as long as it has correct syntax.
What is the purpose of a searching algorithm?
To find a specific value (target) in a list of data.
What are the two searching algorithms?
Linear search and binary search.
How does a linear search work?
It checks each item in the list one by one until the target is found or the end is reached.
What type of data can linear search be used on?
Any list-sorted or unsorted.
What are two advantages of linear search?
Simple to write and works on unsorted data.
What is a major disadvantage of linear search?
It is slow on large data sets.
How does binary search work?
It repeatedly divides a sorted list in half and compares the middle item to the target.
What is the main requirement for using binary search?
The list must be sorted in order.
Why is binary search more efficient than linear search?
It halves the number of items that need to be checked with each step, so it is faster for large data sets.
What are the downsides of binary search?
More complex to code and only works on sorted data.
What is meant by “divide and conquer” in binary search?
“Divide and conquer” refers to how the algorithm splits the list in half each time when trying to find the target.