šŸŽ New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Programming Concepts Intermediate

What is Big O Notation?

A mathematical notation that describes the worst-case performance of an algorithm as input size grows.

Big O describes how an algorithm scales. O(1) is constant time (hash lookup). O(log n) is logarithmic (binary search). O(n) is linear (simple loop). O(n log n) is linearithmic (efficient sorting). O(n²) is quadratic (nested loops). O(2^n) is exponential.

Understanding Big O helps choose the right algorithm and data structure. For example, searching a sorted array with binary search O(log n) is vastly faster than linear search O(n) for large datasets.

Related Terms

SOLID Principles
Five design principles for writing maintainable, flexible object-oriented code: Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion.
SOLID Principles Breakdown
Five object-oriented design principles that guide developers in creating maintainable, flexible, and scalable software systems.
Stack
A data structure that follows Last-In-First-Out (LIFO) ordering, where elements are added and removed from the same end (top).
Recursion
A programming technique where a function calls itself to solve a problem by breaking it into smaller subproblems.
Observer Pattern
A design pattern where an object (subject) maintains a list of dependents (observers) that are notified automatically of state changes.
Factory Pattern
A creational design pattern that provides an interface for creating objects without specifying their exact classes.
View All Programming Concepts Terms →