StudyG Logo
Study G
Concept Breakdowns

Big O Notation Time Complexity Analysis

These flashcards cover Big O notation — the standard language for describing algorithm efficiency in CS courses and technical interviews. Learn to classify time complexities from O(1) to O(n!), recognize common patterns, and analyze code for its growth rate. Essential for LeetCode, FAANG interviews, and every algorithms course.

Interactive Deck

5 Cards
1
Front

What does Big O notation measure?

Click to reveal
1
Back

Big O describes how an algorithm's runtime (or space) scales with input size n in the worst case, ignoring constants and lower-order terms.

2
Front

O(log n) — what causes it?

Click to reveal
2
Back

Logarithmic: Input is halved each iteration.

  • Binary search
  • Balanced BST operations
  • Divide-and-conquer where subproblems don't overlap
3
Front

O(n log n) — what causes it?

Click to reveal
3
Back

Linearithmic: Sorting algorithms that divide and merge.

  • Merge sort
  • Heap sort
  • Quick sort (average case) Best achievable for comparison-based sorting.
4
Locked

What is amortized time complexity?

5
Locked

Rank these from fastest to slowest

Master this topic effortlessly.

Study G helps you master any topic effortlessly using proven learning algorithms and smart review timing

Download Study G

Frequently Asked Questions

What is the difference between Big O, Big Theta, and Big Omega?

Big O is the worst-case upper bound. Big Omega (Ω) is the best-case lower bound. Big Theta (Θ) is the tight bound (both upper and lower). In interviews, 'Big O' typically means tight bound by convention.

How do I calculate the Big O of a nested loop?

Multiply the complexities of nested loops. Two nested loops each iterating n times = O(n²). Three nested = O(n³). If inner loop depends on outer variable, analyze the sum — often still O(n²).

Why do we drop constants in Big O?

Big O describes asymptotic growth as n → ∞. Constants become irrelevant at large scale — O(2n) and O(100n) both grow linearly, so both are O(n). This simplifies comparison between algorithms.