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.
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.
multiple choice
Ready to test yourself?
Sign up free to answer, score points, and build your streak.