juniorBig-O Notation
What is O(n^2) - Quadratic Time Complexity?
Updated Apr 28, 2026
Short answer
Big-O is a mathematical notation used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity.
Deep explanation
In computer science, it describes the execution time or space used by an algorithm relative to the input size (n). It provides a high-level understanding of scalability, focusing on the growth rate rather than exact milliseconds or bytes.
Real-world example
Reading a book page by page (O(n)) vs. checking the index to jump to a page (O(1) effectively).
Common mistakes
- Confusing the number of lines of code with the complexity.
Follow-up questions
- What is Omega notation?
- What is Theta notation?