Does Big-O notation tell you how many seconds an algorithm will take?
No - Big-O describes the growth rate of work relative to input size, ignoring constants and hardware; actual seconds depend on the machine and implementation. Learn it step by step →
Algorithms & Computation is a core part of A-Level Computer Science. Revise the key concepts and common mistakes below, then lock them in with the free games.
Key concepts
AlgorithmA precise step-by-step method for solving a problem.
Pseudocode & flowchartsWays to express an algorithm before coding.
SearchingLinear search (any list) and binary search (sorted list).
SortingOrdering data, e.g. bubble, merge and insertion sort.
DecompositionBreaking a problem into smaller parts.
AbstractionHiding unnecessary detail to focus on what matters.
Binary TreeA tree where each node has at most two children.
GraphA set of vertices connected by edges, directed or undirected.
DFSDepth-first search — explores as deep as possible before backtracking.
BFSBreadth-first search — explores all neighbours before going deeper.
Merge SortA divide-and-conquer sort with O(n log n) time complexity.
Questions where students often pick the tempting wrong answer — make sure you know the right one:
Does Big-O notation tell you how many seconds an algorithm will take?✗ Yes - O(n) means the algorithm takes n seconds to run.✓ No - Big-O describes the growth rate of work relative to input size, ignoring constants and hardware; actual seconds depend on the machine and implementation.
Is quicksort always faster than merge sort?✗ Yes - the name quicksort means it is the fastest sort in all cases.✓ No - quicksort averages O(n log n) but degrades to O(n^2) with poor pivots, while merge sort guarantees O(n log n) in every case.
A* differs from Dijkstra's algorithm because A*:✗ Only works on unweighted graphs✓ Adds a heuristic estimate of the distance remaining to the goal
What is the worst-case complexity of bubble sort?✗ O(n) because it just passes through the list.✓ O(n squared).
Practise Algorithms & Computation — free games
Test yourself with these quick revision games for this topic: