Five Time Complexities in Programming
Five Time Complexities in Programming
Time complexity is a measure of how long an algorithm takes to run as the input size increases. It's
expressed using big O notation, which provides an upper bound on the growth rate of the algorithm's
running time.
Meaning: The algorithm's running time remains the same regardless of the input size.
Meaning: The running time increases logarithmically with the input size.
Example: Binary search, where the search space is halved in each iteration.
3. Linear Time (O(n))
Meaning: The running time increases linearly with the input size.
Meaning: The running time increases quadratically with the input size.
Meaning: The running time increases exponentially with the input size.