Fundamentals of Algorithms — AQA GCSE Computer Science
An algorithm is a sequence of steps that solves a problem or completes a task. This unit covers how algorithms are designed, represented, and how searching and sorting work.
Computational thinking
- Abstraction — removing unnecessary detail to focus on what matters.
- Decomposition — breaking a problem into smaller, manageable sub-problems.
- Algorithmic thinking — identifying the steps needed to solve a problem.
Representing algorithms
Algorithms can be shown as pseudo-code or flowcharts. You should be able to trace an algorithm (work through it step by step), find errors and correct them, and write your own.
Searching algorithms
- Linear search — checks each item in turn until the target is found or the list ends. Works on unordered lists but is slower for large lists.
- Binary search — repeatedly checks the middle item of an ordered list and discards half the list each time. Much faster, but the list must be sorted first.
Sorting algorithms
- Bubble sort — repeatedly compares adjacent items and swaps them if they are in the wrong order, passing through the list until no swaps are needed. Simple but inefficient for large lists.
- Merge sort — uses divide and conquer: splits the list into single items, then repeatedly merges them back together in order. More efficient for large lists.
You should be able to compare these algorithms in terms of efficiency (number of steps).
Exam tips
- Define abstraction, decomposition and algorithmic thinking.
- Be able to trace, correct and write algorithms in pseudo-code and flowcharts.
- Binary search needs an ordered list; linear search does not.
- Compare bubble sort (simple, slow) and merge sort (divide and conquer, faster).