GCSE / Computer
Fundamentals of Algorithms
Learn the core GCSE Computer Science concepts behind algorithms, including decomposition, abstraction, pseudocode, flowcharts, inputs, processing and outputs, trace tables, algorithm efficiency, linear and binary search, and bubble and merge sort. This topic explains how algorithms are designed, represented, tested and compared in exam-style contexts.
An algorithm is a finite sequence of clear, ordered instructions used to solve a problem or complete a task. In computer science, algorithms describe the logical steps required to transform inputs into outputs. A computer program is an implementation of an algorithm in a programming language; an algorithm itself is not a computer program.
Decomposition is a computational thinking technique in which a large or complex problem is broken down into smaller, more manageable sub-problems. Each sub-problem can be solved separately and the solutions combined to produce the complete solution.
Abstraction means removing or ignoring unnecessary detail so that attention can be focused on the important information needed to solve a problem. Abstraction helps simplify complex problems and makes algorithms easier to design and understand.
A systematic approach to problem solving involves identifying the problem, determining the required inputs and outputs, decomposing the problem, applying abstraction, designing an algorithm, testing it and refining the solution where necessary.
Algorithms can be represented using pseudocode, program code or flowcharts. Pseudocode expresses the logical steps of an algorithm in a structured, language-independent form, while flowcharts represent the sequence of operations visually using standard flowchart symbols and diagrams.
Common flowchart symbols include an oval or rounded shape for start/end, a rectangle for a process, a parallelogram for input/output, a diamond for a decision and arrows to show the direction of control flow. Students should be able to read and construct simple flowcharts.
Simple algorithms can be analysed in terms of input, processing and output. Input is the data supplied to the algorithm, processing is the set of operations performed on that data, and output is the information or result produced.
The purpose of an algorithm can be determined by following its instructions step by step. Trace tables and visual inspection can be used to record changing variable values, follow decisions and loops, identify outputs and explain what an algorithm does.
More than one algorithm may solve the same problem. Algorithms can therefore be compared according to how effectively and efficiently they solve the task. At GCSE level, comparisons of algorithm efficiency focus mainly on time efficiency.
A linear search checks items one at a time from the beginning of a list until the required item is found or every item has been checked. It can work on either sorted or unsorted data but may require checking many items.
A binary search repeatedly compares the required item with the middle item of a sorted list. Half of the remaining search area is discarded after each comparison until the item is found or no items remain. Binary search requires the data to be sorted.
Linear search is simple and works with unsorted data, whereas binary search generally requires fewer comparisons on large datasets but only works correctly when the data is ordered. Students should be able to compare the advantages and disadvantages of both searching algorithms.
Bubble sort repeatedly compares neighbouring items and swaps them when they are in the wrong order. Multiple passes are made through the list until no more swaps are required and the data is fully sorted.
Merge sort repeatedly divides a list into smaller sections until individual items remain, then merges the sections back together in the correct order. It is generally more efficient than bubble sort for larger collections of data.
Bubble sort is relatively simple to understand and implement but can require many comparisons and swaps. Merge sort is normally faster for large datasets but is more complex and requires additional storage while merging. Students should be able to explain and compare the mechanics, advantages and disadvantages of both sorting algorithms.