Algorithms / Runtime guide
Big O Notation
Get familiar with the different runtimes that are possible for algorithms. Learn to read the notation, spot the shape of a solution, and compare two approaches before you run them.
Overview
Big O Notation
A plain language introduction to Big O notation, growth rates, and how to read the notation without fear.
Read O(1)Constant
Constant time work does not grow with the input. See why array access and simple lookups stay flat.
Read O(n)Linear
Linear time means one pass over the input. Learn to spot it in loops and array methods.
Read O(n²)Quadratic
Nested loops multiply the work. See why quadratic code slows down so quickly and how to spot it.
Read O(log n)Logarithmic
Logarithmic time halves the problem on every step. Binary search is the clearest example.
Read O(2â¿)Exponential
Exponential time doubles with every new input. See why naive recursion becomes impractical.
Read