Explore

Big-O Notation: Measuring How Code Scales

by Froga

Big-O notation is how programmers describe how an algorithm's speed changes as the amount of data grows. This room covers the common complexity classes and what they mean for real programs, for anyone just starting to learn algorithms.

You're previewing this room. Log in or create a free account to answer the questions and track your progress.
Study material

Big-O notation describes how an algorithm's running time or memory use grows as its input gets larger, not the exact number of seconds it takes. An algorithm that is O(1) takes the same amount of time no matter how big the input is. One that is O(n) takes time roughly proportional to the input size, and one that is O(n^2) slows down much faster as the input grows. Two algorithms with the same Big-O can still run at different real speeds, but Big-O tells you how badly performance degrades as the problem gets bigger.

What does Big-O notation describe about an algorithm?

multiple choice

AHow many total lines of code the program has
BHow its running time or memory use grows with input size
CHow much disk space the compiled program takes up
DHow many people worked on writing the program
Log in to answer

Ready to test yourself?

Sign up free to answer, score points, and build your streak.

Big-O Notation: Measuring How Code Scales · Froga