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
Analysis of algorithms
(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!
===Orders of growth=== {{main|Big O notation}} Informally, an algorithm can be said to exhibit a growth rate on the order of a [[Function (mathematics)|mathematical function]] if beyond a certain input size {{mvar|''n''}}, the function {{math|''f''(''n'')}} times a positive constant provides an [[Asymptotic analysis|upper bound or limit]] for the run-time of that algorithm. In other words, for a given input size {{mvar|''n''}} greater than some {{mvar|''n''}}<sub>0</sub> and a constant {{mvar|''c''}}, the run-time of that algorithm will never be larger than {{math|''c'' Γ ''f''(''n'')}}. This concept is frequently expressed using Big O notation. For example, since the run-time of [[insertion sort]] [[quadratic growth|grows quadratically]] as its input size increases, insertion sort can be said to be of order {{math|''O''(''n''<sup>2</sup>)}}. Big O notation is a convenient way to express the [[Best, worst and average case|worst-case scenario]] for a given algorithm, although it can also be used to express the average-case — for example, the worst-case scenario for [[quicksort]] is {{math|''O''(''n''<sup>2</sup>)}}, but the average-case run-time is {{math|''O''(''n'' log ''n'')}}.
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)