Time and space complexity of the algorithm used

When describing the complexity of the algorithm, often used in O (1), O (n), O (logn), O (nlogn) to represent the complexity of the correspondence, but at the moment we have by default these ways represent the spatial complexity .

Then, O (1), O (n), O (logn), O (nlogn) can be seen as showing either the complexity of the algorithm, may also represent the spatial complexity.

Big O plus () form, which is wrapped in fact a function f (), O (f ()), indicate the relationship between consuming / consumption data space and increase the amount of an algorithm. Where n represents the amount of input data.

 

 

 

If the n-th power aⁿ = b (a> 0, and a ≠ 1), called a equals b. Here, called A base number, n-called index,

b is called the n-th power to a bottom.

If written in logarithmic form is:

 

Here, still called a base number, b is called real numbers, and n is called a logarithm to the base b.

Thus, exponential and logarithmic is n, that is, they refer to the same thing, just called different names in different occasions.

In particular, we call on the base 10 number is called the common logarithm (common logarithm), and recorded as lg.

In said irrational number e (e = 2.71828 ...) is referred to as the base of the logarithm natural logarithm (natural logarithm), and referred to as ln.

 

 

 

 

Guess you like

Origin www.cnblogs.com/adspark/p/11840030.html