B2.4.1

Describe the efficiency of specific algorithms by calculating their Big O notation to analyse their scalability

Big O notation describes the upper bound of an algorithm's growth rate — how time (or space) increases as input size ($n$) grows.

2 min read263 words

What is Big O Notation?

Big O notation describes the upper bound of an algorithm’s growth rate — how time (or space) increases as input size (nn) grows.

Time Complexity

NotationNameGrowthExample
O(1)ConstantStays the same regardless of nnAccessing array element by index
O(log n)LogarithmicGrows slowly as nn increasesBinary search
O(n)LinearGrows proportionally to nnLinear search, single loop
O(n log n)LinearithmicSlightly worse than linearMerge sort, quick sort
O(n²)QuadraticGrows with n2n^2Bubble sort, insertion sort, nested loops
O(n³)CubicGrows with n3n^3Triple nested loops
O(2ⁿ)ExponentialDoubles with each increment to nnRecursive Fibonacci
O(n!)FactorialWorst growth — explodes rapidlyGenerating all permutations

Big O Growth Chart

n!
O(2ⁿ)
O(n³)
O(n²)
O(n log n)
O(n)
O(log n)
O(1)

    Growth slows as n increases

Space Complexity

Space complexity measures how much extra memory an algorithm needs relative to input size.

NotationNameWhat it meansExample
O(1)ConstantFixed memory, does not grow with nnSingle variable, loop counter
O(log n)LogarithmicMemory grows with logn\log nRecursive binary search
O(n)LinearMemory grows with nnCreating a new array, hash table
O(n²)QuadraticMemory grows with n2n^22D array / nested list creation

Start typing to search all published objectives.