Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Best, worst and average case
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Redirect|worst case|the 2010 James Patterson novel|Worst Case|the case|worst-case scenario}} {{Short description|A measure of how efficiently algorithms use resources}} {{Refimprove|date=March 2009}} In [[computer science]], '''best''', '''worst''', and '''average cases''' of a given [[algorithm]] express what the [[Resource (computer science)|resource]] usage is ''at least'', ''at most'' and ''on average'', respectively. Usually the resource being considered is running time, i.e. [[time complexity]], but could also be memory or some other resource. Best case is the function which performs the minimum number of steps on input data of n elements. Worst case is the function which performs the maximum number of steps on input data of size n. Average case is the function which performs an average number of steps on input data of n elements. In [[real-time computing]], the [[worst-case execution time]] is often of particular concern since it is important to know how much time might be needed ''in the worst case'' to guarantee that the algorithm will always finish on time. [[average-case complexity|Average performance]] and [[worst-case complexity|worst-case performance]] are the most used in algorithm analysis. Less widely found is [[best-case performance]], but it does have uses: for example, where the best cases of individual tasks are known, they can be used to improve the accuracy of an overall worst-case analysis. [[Computer scientist]]s use [[probabilistic analysis]] techniques, especially [[expected value]], to determine expected running times. The terms are used in other contexts; for example the worst- and best-case outcome of an epidemic, worst-case temperature to which an electronic circuit element is exposed, etc. Where components of specified [[Engineering tolerance|tolerance]] are used, devices must be designed to work properly with the worst-case combination of tolerances and external conditions.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)