Summary

  • Elaborate on the benefits of using asymptotic notation and worst-case analysis to study the computational complexity of algorithms.

The Big-Oh notation and worst-case analysis are tools that greatly simplify our ability to compare the efficiency of algorithms.

  • Asymptotic analysis means using asymptotic notation to describe the computational complexity of an algorithm.
  • Computational complexity generally means time complexity and space complexity.
  • If it is not specified, we mean time complexity.
  • If it is not specified, we mean worst-case analysis.
  • If it is not specified, we want Big-Oh notation.
  • When using Big-Oh, give the tightest upper bound you can find.
  • When using big Omega, give the tightest lower bound you can find.
  • If it is not specified, space complexity should include input and auxiliary space.
NotationDefinition
O\OmicronBig-Oh: T(n)T(n) is a member of O(f(n))\Omicron(f(n)) if and only if there exist positive constants cc and n0n_0 such that T(n)cf(n)T(n)\le c f(n) for all nn0n\ge n_0.
Ω\OmegaBig Omega: T(n)T(n) is a member of Ω(f(n))\Omega(f(n)) if and only if there exist positive constants cc and n0n_0 such that T(n)cf(n)T(n)\ge c f(n) for all nn0n\ge n_0.
Θ\ThetaBig Theta: T(n)T(n) is a member of Θ(f(n))\Theta(f(n)) if and only if there exist positive constants c1c_1, c2c_2 and n0n_0 such that c1f(n)T(n)c2f(n)c_1 f(n) \le T(n) \le c_2 f(n) for nn0n\ge n_0.

The following illustration is taken from the bible of Algorithm, the CLRS book:

There are other asymptotic notations (Little Oh, Little Omega, etc.) which I have spared you the grief of knowing!

Resources

For a brief & concise overview, refer to any of the following:

For an in-depth, detailed, formal (mathematical) discussion of asymptotic analysis, refer to chapter 3, "Growth of Functions," in CLRS: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein, Introduction to Algorithms. 3rd ed, MIT Press, 2009.