Skip to main content
AllDevToolsHub
📈

Big O Complexity Cheatsheet

100% Local

Interactive reference for algorithm performance and complexity.

Big O Complexity Cheatsheet
Algorithm Performance Guide

Big O Complexity Cheatsheet

The engineer's definitive guide to time and space complexity evaluation.

O(1)
Excellent
Constant Time

"The execution time remains constant, regardless of the size of the input data."

Example

Accessing an array element by index.

O(log n)
Great
Logarithmic Time

"Execution time grows logarithmically with input size (doubling input only adds a constant step)."

Example

Binary search in a sorted array.

O(n)
Fair
Linear Time

"Execution time increases proportionally with the size of the input data."

Example

Finding an element in an unsorted list.

O(n log n)
Acceptable
Linearithmic Time

"Execution time is slightly more than linear, common in efficient sorting algorithms."

Example

Merge Sort, Quick Sort (average).

O(n²)
Poor
Quadratic Time

"Execution time is proportional to the square of the input size (nested loops)."

Example

Bubble Sort, Insertion Sort.

O(2ⁿ)
Terrible
Exponential Time

"Execution time doubles with each additional element in the input."

Example

Recursive calculation of Fibonacci.

O(n!)
Worst
Factorial Time

"Execution time grows extremely fast, common in permutations."

Example

Solving the Traveling Salesman problem via brute force.

Operation Costs
Average Case Complexity
Structure
Access
Search
Insert
Delete
Array
O(1)
O(n)
O(n)
O(n)
Hash Table
N/A
O(1)
O(1)
O(1)
Linked List
O(n)
O(n)
O(1)
O(1)
Binary Tree
O(log n)
O(log n)
O(log n)
O(log n)
Stack / Queue
O(n)
O(n)
O(1)
O(1)

Time Complexity

How the runtime of an algorithm grows as the input size increases.

Space Complexity

The amount of extra memory used relative to the input size.

Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.

Click any algorithm to see its time and space complexity. Filter by data structure or operation type.

Overview

What is Big O Complexity Cheatsheet?

A comprehensive guide to time and space complexity. Explore Big O notations from O(1) to O(n!) with practical examples and data structure operation comparisons.
FAQ

Frequently Asked Questions

Reference

Technical Deep Dive

DEVELOPMENT TOOLS

Big O Complexity Cheatsheet

A comprehensive guide to time and space complexity. Explore Big O notations from O(1) to O(n!) with practical examples and data structure operation comparisons.

Built for Devs

Designed by people who use these tools in production every day.

🧠

Smart Defaults

Reasonable assumptions out of the box, every assumption overridable when you need it.

🚀

Workflow-Friendly

Pairs with your IDE, CI, and code review, output drops into commits and PRs cleanly.

01 Growth Scale Matrix

Notation Name 10 Items 1M Items Practicality
O(1)Constant1 op1 opIdeal
O(log n)Logarithmic3 ops20 opsExcellent
O(n)Linear10 ops1M opsGood
O(n log n)Linearithmic33 ops20M opsScalable
O(n²)Quadratic100 ops10¹² opsSlow @ Scale

02 Algorithm Optimization Pipeline

1
Complexity Identification The algorithm is decomposed into loops, recursion levels, and branch operations to determine its highest-order term.
2
Asymptotic Analysis Constants and lower-order terms are discarded to isolate the scaling behavior (worst-case, average, or best-case).
3
Capacity Verification Performance is simulated against target data volumes to verify feasibility within target latency budgets.

You Might Also Need