n | Max Time Complexity | Common Name |
---|---|---|

n <= 12 | O(n!) | Factorial |

n <= 25 | O(2^{n}) |
Exponential |

n <= 100 | O(n^{4}) |
Quartic |

n <= 500 | O(n^{3}) |
Cubic |

n <= 10^{4} |
O(n^{2}) |
Quadratic |

n <= 10^{6} |
O(n log n) | Linearithmic |

n <= 10^{8} |
O(n) | Linear |

n > 10^{8} |
O(log n) or O(1) | Logarithmic and Constant respectively |

One trick to figuring out the expected time complexity is to substitute n and check that the result is 10^{8}.

Put another way: log_{10}(n) should output 8.

For example:
log_{10}(n!) is only equal to 8 when n is 12.
Similarly, log_{10}(n^{2}) is only equal to 8 when n is 10^{4}.

We consider 10^{8} because that is usually the upper bound on the number of elements in most coding contests.

This technique is particularly helpful for more complicated complexity analysis. If you have O(MN log M) as the complexity of your algorithm, you can subsitute N and M (constraints) to determine if output is 10^8 and consequently whether your algorithm is fast enough.