Time Complexity
Asymptotic Notations
Big oh - - Upper bound - iff - Any higher/equal order function than average case
Big omega - - Lower bound - iff - Any lower/equal order function than average case
Theta - - Average bound - iff



Properties
Reflexive
Transitive
Symmetric
Transpose Symmetric
Comparing Functions
Functions can be directly compared, however, two functions can be of same complexity (asymptotically equal) even if their constants are unequal. Natively constants do not hold significance in comparing functions.
If two functions cannot be directly compared (i.e. powers exist), logarithms can be used to compare such functions, however, when taking logarithm - any constants generated by application of logarithm DO HOLD significance and hence after application of logarithm, two functions cannot be asymptotically equal if they have differing constant coefficients.
Big O Cheat Sheet

Calculating complexity
1 sec = operations (approx.)
Example
Time constraint: 20 seconds
Here to find out the time complexity, consider which would equal to 400 seconds. Hence, time complexity here should be less than .
Last updated