Logo

Craig 'n' Dave

Big O notation cheat sheet

A handy reference of the Big O notation for all the algorithms.

This cheat sheet illustrates the notation and description of time complexity with example code. Each is written in order of lowest to highest complexity and colour coded from O(1) green to O(2^n) red for easy reference.

The best, average and worst time complexity is shown for the linear search, binary search, hash table / dictionary search, depth and breadth first searches.

The best, average, worst time complexity and space complexity is shown for the bubble sort, insertion sort, merge sort and quick sort.




Registered in England and Wales: 10442992

VAT Number: 290 9845 58

Telephone: 01452 947500

Email: admin@craigndave.co.uk

Bett Awards 2024 finalist badge
Teach Secondary Awards 2023 winners badge
ERA Awards 2023 finalist badge
Teach Secondary Awards 2022 finalist badge
Bett Awards 2022 finalist badge