Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Skill

Complexity Analysis

Predict how running time and memory grow with input size, including amortized cost, and check those predictions with measurements.

Intro1 roadmap

4 objectives 6 steps about 125 min

Learn it step by step

Read the lessons in order, try the practice checks, then prove the skill with the knowledge check.

Start learning

This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.

Learning objectives

  • Derive Big-O time and space bounds for code with sequential, nested and multi-input loops, dropping constants and lower-order terms correctly.
  • Distinguish best, worst, average and amortized cost, and explain why appending to a dynamic array is amortized O(1).
  • Use input-size limits to decide which complexity class a solution must reach (for example, n = 10^5 rules out O(n^2)).
  • Benchmark two implementations across growing inputs with timeit and explain whether the measurements match the asymptotic prediction.

Lesson plan

6 steps, about 125 min · 5 of 5 lessons available so far

  1. Counting Steps Instead of Seconds Concept · 20 min
  2. Reading Loops: From Code to a Bound Worked example · 25 min
  3. Worst Case, Average Case and Amortized Cost Concept · 20 min
  4. Budgeting Operations from Input Limits Worked example · 15 min
  5. Lab: Timing Growth Curves with timeit Lab · 30 min
  6. Check: Predict, Then Measure Knowledge check · 8 questions

Practise it

Given six short Python functions, write the time and space bound of each, then benchmark two of them at n = 10^3 to 10^6 with timeit and tabulate whether the growth ratios match your prediction. Use a fixed runtime budget and stop infeasible input sizes early; retain raw timings and separate a growth hypothesis from a correctness argument.

Build it from scratch

Practice builds that exercise this skill by re-creating a real technology.

Browse 2 tutorials that practise it

References