Big O Notation
44 cards · 🇺🇸 English
Time and space complexity analysis for common algorithms and operations.
Study all 44 cards for free
Flashcards, quizzes, pixel-art games and a daily review that remembers for you.
Try the first 10 cards
1 / 10Big O notation
Tap the card for the answer · swipe right if you knew it, left if not
Already have an account? Sign in
Cards
- 1Big O notationA mathematical notation that describes the limiting behavior of a function when the argument tends toward infinity, used to classify algorithms by how their run time or space requirements grow as input size grows
- 2Letter 'O'Ordnung (German for 'order'), meaning the order of approximation
- 3F(n) = O(g(n))The function f is bounded above by g (up to a constant factor) asymptotically
- 4O(1) complexityConstant time - the algorithm takes the same amount of time regardless of input size
- 5O(log n) complexityLogarithmic time - typical for algorithms that divide the problem in half each step (e.g., binary search)
- 6O(n) complexityLinear time - the algorithm's runtime grows linearly with input size
- 7O(n log n) complexityLinearithmic or quasilinear time - typical for efficient comparison-based sorting algorithms like merge sort and heapsort
- 8O(2ⁿ) complexityExponential time - the runtime doubles with each additional input element
- 9Little-o notationA notation where f(n) = o(g(n)) means f grows much slower than g asymptotically
- 10Big Omega (Ω) notationA notation that provides a lower bound on the growth rate of a function (f is bounded below by g)
- 11Big Theta (Θ) notationA notation meaning f is bounded by g both above and below (tight bound) - f and g have the same order of growth
- 12F(n) ~ g(n)Asymptotic equivalence - f is equal to g asymptotically (the ratio f/g approaches 1)
- 13Complexity of finding an item in a sorted array with binary searchO(log n)
- 14Complexity of finding an item in an unsorted list with linear searchO(n)
- 15Best possible time complexity for comparison-based sortingO(n log n) in the average case
- 16Time complexity of quicksort in the average caseO(n log n)
- 17Worst-case time complexity of quicksortO(n²)
- 18Time complexity of merge sortO(n log n) for all cases (best, average, and worst)
- 19Time complexity of bubble sortO(n²) in the worst and average cases, O(n) in the best case (already sorted)
- 20Time complexity of insertion sortO(n²) in the worst and average cases, O(n) in the best case
- 21Space complexity of an algorithmThe amount of additional memory space required by the algorithm as a function of input size
- 22'in-place'An algorithm that requires only O(1) or O(log n) additional space beyond the input
- 23Amortized time complexityThe average time per operation over a worst-case sequence of operations
- 24Inverse Ackermann function's complexityO(α(n)), which grows extremely slowly - effectively constant for practical purposes (used in disjoint-set operations)
- 25Polylogarithmic timeO((log n)^k) for some constant k - slower than logarithmic but faster than any polynomial
- 26Superpolynomial functionA function that grows faster than n^c for any constant c
- 27Subexponential functionA function that grows more slowly than c^n for any constant c > 1
- 28Can you ignore constant factors in Big O notation?Yes, constants are omitted: O(5n) = O(n), O(3n²) = O(n²)
- 29Can you drop lower-order terms in Big O notation?Yes: O(n² + n) = O(n²), O(n³ + n² + n) = O(n³)
- 30Is Big O notation an equality or an inequality?It's actually an inequality (upper bound) despite using the = symbol, representing 'is element of' a set
And 14 more cards. Study the whole deck free
Articles about this deck
More Programming decks
See all- 🧱
Data Structures
95 cards · 🇺🇸 English
Arrays, linked lists, trees, graphs, hash tables and their core operations.
- 🧱
Estructuras de Datos
95 cards · 🇺🇸 English
Arrays, listas enlazadas, árboles, grafos, tablas hash y sus operaciones fundamentales.
- 🏗️
Design Patterns & OOP/SOLID Principles
60 cards · 🇺🇸 English
The Gang of Four design patterns plus object-oriented and SOLID principles.
- ⏱️
Notación Big O
44 cards · 🇺🇸 English
Análisis de la complejidad temporal y espacial de algoritmos y operaciones comunes.
- ✅
Testing: Unit & Integration
40 cards · 🇺🇸 English
Unit testing, integration testing, mocking, and testing best practices.
- 🧱
Datenstrukturen
95 cards · 🇺🇸 English
Arrays, verkettete Listen, Bäume, Graphen, Hash-Tabellen und ihre wichtigsten Operationen.
