Big-O Guide | Lilac & Logic

Lesson 03

Understanding Big-O Notation

A clear guide to measuring how algorithm runtime and memory usage scale as your input grows.

What is Big-O Notation?

Big-O notation is a mathematical framework used by computer scientists to describe how an algorithm performs. Rather than measuring exact execution time in seconds (which varies depending on computer hardware), Big-O measures how the number of required operations grows relative to the input size.

Common Time Complexities

Here are the fundamental growth rates you will encounter when studying algorithms, ordered from fastest to slowest:

Big-O Comparison Cheat Sheet

Use this reference table to evaluate algorithm efficiency at a glance:

Big-O Notation Name Performance Rating Example Operation
O(1) Constant Excellent Array lookup by index
O(log n) Logarithmic Good Binary Search
O(n) Linear Fair Linear Search
O(n log n) Linearithmic Acceptable Merge Sort
O(n²) Quadratic Horrible Bubble Sort
← Previous Lesson: Searching Return Home →