DSA and problem solving

Stage 1 · Lesson 1 of 6

What Big-O means and the common growth rates

Complexity and Big-O

describes how much more work code does as its input gets bigger. This is called its time complexity. It keeps only the part that grows fastest and ignores fixed multipliers, so 3n² + 5n + 20 is simply O(n²).

Learn the in order, with the kind of code behind each. O(1) takes the same few steps whatever the input. O(log n) cuts the problem in half at each step.

O(n) looks at every item once. O(n log n) is what good sorting costs. O(n²) compares every pair of items.

O(2^n) checks every possible . The gaps are huge: for a million items, O(n log n) is about 20 million steps, while O(n²) is a trillion.

A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking Algorithm Complexity and Big-O

    Design Gurus · Beginner · Subscription

    Short course on exactly this stage, including the amortised and space cases people miss

  • CourseFree
    Algorithms, Part I

    Princeton University · Intermediate

    Free: the Analysis of Algorithms module measures real Java programs, then models their cost

Keep handy

Also worth your time

Mark this stage as not done?