# What is the complexity of the algorithm

## Time complexity and O notation

(see also Wikipedia: Time complexity, Space complexity, Landau symbol)

Usually it is difficult or impossible to give the exact equation for the time T (n) for an algorithm. One tries to estimate the effort asymptotically, i. H. one tries to find as simple a function as possible, which limits the function of the expenditure of time for large n. It should therefore apply that T (n) ≤ c · f (n) applies from a certain element n_{0}, where c is a positive constant. This estimate is also referred to as the asymptotic order O (f).

Here is the exact, mathematical formulation of the asymptotic order: O (f) = {T | T: ** N** → ** R.**_{0}^{+} and ∃c ∈ ** R.**^{+} ∃n_{0} ∈ ** N** ∀n ≥ n_{0}: T (n) ≤ c · f (n)}

Example:

The function of the expenditure of time T (n) = 3n is given

^{2}- 6n + 9 Which function can be used as an estimate?T (n) is a quadratic function, which in turn has a quadratic function, namely f (n) = n

^{2}should be approached asymptotically.

So T (n) ≤ c · f (n), i.e. 3n^{2}- 6n + 9 ≤ c n^{2 }be valid. If one sets c = 3, the equation can be transformed in an elementary way and one obtains:

For all n ≥ 1.5 the expression 1.5 · n is restricted

^{2}the function T (n). Thus for the function T (n) ∈ O (n^{2}).

Accordingly, polynomial algorithms of degree k always have a runtime cost of O (n^{k}), exponential algorithms require the effort O (2^{n}), O (n!) Or O (n^{n}).

- How is globalization affecting the country?
- How is shoplifting affecting the business?
- Which companies have a culture deck
- Why is Fortnite still popular
- Laundromats are a profitable business
- We will live in heaven for eternity
- Dear foreigners Singapore
- What foods can reverse diabetes
- Who are the toughest cricketers ever
- Where can I get high quality newsletter services

- The placebo effect could work the other way round
- Why do Gatling cannons spin
- How do I structure a software project
- What is the afterlife like for the dead
- A Magento store cannot use extensions
- What page speed does Google SEO use
- Are toilet tank cleaning tablets worth using?
- Empaths have narcissistic traits
- Have you ever done business with Quora
- Why are you in relationship with someone
- How was life in the 60s
- What does beer foam do
- How can fossil fuels be replaced
- What are the best major Protestant seminars
- What is Asymptotic Flatness in Differential Geometry
- Alcohol decreases IQ
- Should the schools bring beating back
- When did you start speaking in public?
- Did the Nazis enjoy killing?
- What are the best information retrieval models
- Should I start lifting weights when I was 14?
- What are the sources of water treatment
- Why does Quora recommend comments
- Is honey healthy