Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Best and worst cases


In computer science, best and worst cases in a given algorithm express what the resource usage is at least and at most, respectively. An algorithm's average performance is its behavior under "normal conditions". In almost all situations the resource being considered is running time, but it could also be memory, for instance. The worst case is most of concern since it is of critical importance to know how much time would be needed to guarantee the algorithm would finish.

Average performance and worst-case performance are the most used in algorithm analysis while best-case performance is more of a fantasy description of an algorithm. Computer scientists use probabilistic analysis techniques, especially expected value, to determine expected average running times

1 Worst case vs average case performance

Worst case performance analysis is often easier to do than "average case" performance. Determining what "average input" is in itself difficult, and often that "average input" has properties which make it difficult to characterise mathematically (consider, for instance, algorithms that are designed to operate on strings of text). Similarly, even when a sensible description of a particular "average case" (which will probably only be applicable for some uses of the algorithm) is possible, they tend to result in more difficult to analyse equations.

2 Examples

3 See also

Computational complexity theory

Read more »

Non User