Big-O Reference Chart

Big-O notation reference for common algorithms and data structures with time and space complexity.

33.3Kuses
7.5/10(220)

Complexity Scale (Best to Worst)

O(1) (Constant)
O(log n) (Logarithmic)
O(n) (Linear)
O(n log n) (Linearithmic)
O(n^2) (Quadratic)
O(2^n) (Exponential)
AlgorithmBestAverageWorstSpace
Bubble SortO(n)O(n^2)O(n^2)O(1)
Selection SortO(n^2)O(n^2)O(n^2)O(1)
Insertion SortO(n)O(n^2)O(n^2)O(1)
Merge SortO(n log n)O(n log n)O(n log n)O(n)
Quick SortO(n log n)O(n log n)O(n^2)O(log n)
Heap SortO(n log n)O(n log n)O(n log n)O(1)
Counting SortO(n+k)O(n+k)O(n+k)O(k)
Radix SortO(nk)O(nk)O(nk)O(n+k)
Linear SearchO(1)O(n)O(n)O(1)
Binary SearchO(1)O(log n)O(log n)O(1)
Array AccessO(1)O(1)O(1)O(n)
Array InsertO(1)O(n)O(n)O(n)
Linked List AccessO(1)O(n)O(n)O(n)
Linked List InsertO(1)O(1)O(1)O(n)
Hash Table SearchO(1)O(1)O(n)O(n)
BST SearchO(log n)O(log n)O(n)O(n)
BFSO(V+E)O(V+E)O(V+E)O(V)
DFSO(V+E)O(V+E)O(V+E)O(V)
Dijkstra'sO(E log V)O(E log V)O(E log V)O(V)

About Big-O Notation

Big-O notation describes the upper bound of an algorithm's growth rate. It helps compare algorithms by their efficiency as input size increases.

⚡ Pro OptionsSponsored

Some links on this page are affiliate links. If you click and make a purchase, we may earn a commission at no extra cost to you.

Recommended Products

Ad

Affiliate Disclosure: As an Amazon Associate, ToolBird earns from qualifying purchases. Links above are affiliate links — if you buy through them, we may earn a small commission at no extra cost to you.

Disclaimer: This tool is provided as-is for informational and educational purposes only.

ToolBird Assistant

Find the right tool instantly

Hey! I'm ToolBird Assistant. Tell me what you need and I'll find the right tool for you.