Big Oh Expressions Reference

Big-O Time Complexity

O(1)

Constant time — stays the same regardless of input size.

O(log n)

Logarithmic — grows very slowly (e.g., binary search).

O((log n)2)

Log-squared — slightly faster growth than log n.

O(√n)

Square root — moderate growth, better than linear.

O(n)

Linear — grows directly with input size.

O(n log n)

Efficient sorting (merge/quick sort average case).

O(n2)

Quadratic — nested loops (bubble sort).

O(n3)

Cubic — very slow for large inputs.

O(2n)

Exponential — doubles each step (very expensive).

O(n!)

Factorial — extremely slow (permutations).

Leave a Reply

Your email address will not be published. Required fields are marked *