Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The time complexity of an algorithm refers to the amount of time it takes for the algorithm to run, based on the size of its input. It measures how the runtime increases as the input size increases.
Related terms
Space complexity: The space complexity of an algorithm refers to the amount of memory space required by the algorithm to run, based on the size of its input.
Best case scenario: This term refers to the scenario where an algorithm performs optimally and has its best possible runtime.
Average case scenario: This term refers to the scenario where an algorithm performs with average efficiency, considering all possible inputs.