To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Worst-case complexity

From Wikipedia, the free encyclopedia

In computer science (specifically computational complexity theory), the worst-case complexity measures the resources (e.g. running time, memory) that an algorithm requires given an input of arbitrary size (commonly denoted as n in asymptotic notation). It gives an upper bound on the resources required by the algorithm.

In the case of running time, the worst-case time complexity indicates the longest running time performed by an algorithm given any input of size n, and thus guarantees that the algorithm will finish in the indicated period of time. The order of growth (e.g. linear, logarithmic) of the worst-case complexity is commonly used to compare the efficiency of two algorithms.

The worst-case complexity of an algorithm should be contrasted with its average-case complexity, which is an average measure of the amount of resources the algorithm uses on a random input.

YouTube Encyclopedic

  • 1/3
    Views:
    455
    624
    14 776
  • Big O Part 3 – Quadratic Complexity
  • Above Average-Case Analysis?
  • Hashing | Set 3 (Open Addressing) | GeeksforGeeks

Transcription

Definition

Given a model of computation and an algorithm that halts on each input , the mapping is called the time complexity of if, for every input string , halts after exactly steps.

Since we usually are interested in the dependence of the time complexity on different input lengths, abusing terminology, the time complexity is sometimes referred to the mapping , defined by the maximal complexity

of inputs with length or size .

Similar definitions can be given for space complexity, randomness complexity, etc.

Ways of speaking

Very frequently, the complexity of an algorithm is given in asymptotic Big-O Notation, which gives its growth rate in the form with a certain real valued comparison function and the meaning:

Quite frequently, the wording is:

  • „Algorithm has the worst-case complexity .“

or even only:

  • „Algorithm has complexity .“

Examples

Consider performing insertion sort on numbers on a random-access machine. The best-case for the algorithm is when the numbers are already sorted, which takes steps to perform the task. However, the input in the worst-case for the algorithm is when the numbers are reverse sorted and it takes steps to sort them; therefore the worst-case time-complexity of insertion sort is of .

See also

References

  • Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Chapter 2.2: Analyzing algorithms, pp.25-27.
  • Oded Goldreich. Computational Complexity: A Conceptual Perspective. Cambridge University Press, 2008. ISBN 0-521-88473-X, p.32.
This page was last edited on 11 September 2023, at 10:12
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.