Three types of complexity could be considered when analyzing algorithm performance. These are worst-case complexity, best-case complexity, and average-case complexity. Only worst-case complexity has found to be useful. Worst-Case running time for a function, f(n) such that where a,b and c are constants can be described as a higher bounding limit for the shortest possible running time for any given "n" beyond some instance of "N"(big "n") such that . In this case, is the higher bounding limit on f(n). . We will soon see how for this example. More useful than best-case, since worst-case will tell how long an algorithm will run in the worst possible situation.
Average-Case running time for a function, f(n) such that where a,b and c are constants can be described as an average between best-case and worst-case. Average-case isn't useful because in most cases it's hard to define the average.
Best-Case running time for a function, f(n) such that where a,b and c are constants can be described as a lower bounding limit for the shortest possible running time for any given "n" beyond some instance of "N"(big "n") such that . In this case, is the lower bounding limit on f(n). . We will soon see how for this example. Best-case performance isn't really useful because it doesn't reflect normal operation of the algorithm.
Figure 1: Relationship of Complexity Types