Analysis of Algorithms - Algorithms progressive efficiency analysis

First, the big O notation

      Usually the upper bound for defining a set of functions, the maximum value progressive expressions O (g (n)) is the meaning of, C O, the collection element is constant, the function does not exceed cg (n). f (n) = O (g (n)) is the meaning of the function f (n) belongs to the set of O (g (n)), as a function of the maximum value of the set O is cg (n), therefore f (n ) maximum value of cg (n). Since only the upper bound of progressive, so that when the function g (n) is smaller in the order, the more tightly bound determined.

      Introduction to the algorithm described below is how to view a large O notation.

      When the size of the function of only the upper bound, there is no clear lower bound of the time, you can use the big O notation. f (n) = O (g (n)) formal mathematical definition: the presence of normal number c, n, n0, when n> n0 and for an arbitrary f (n) that meet 0 <= f (n) < = cg (n).
----------------

FIG intuitive visual shown below:

                    

 

Second, large Ω notation

      Usually the lower bound for defining a set of functions, asymptotic expression Ω (g (n)) is the meaning of the minimum value of the function [Omega] is the set of elements not less than cg (n). f (n) = Ω (g (n)) is the meaning of the function f (n) belonging to the set Ω (g (n)), since the minimum value of the function [Omega] is set to cg (n), therefore f (n ) minimum is cg (n).

     Introduction to how the algorithm is described in great Ω notation.     

     When the size of the function of only the lower bound, there is no clear upper bound, they can use a large Ω notation. f formal mathematical definition (n) = Ω (g (n)): the presence of normal number c, n, n0, when n> n0 and for an arbitrary f (n) that meet 0 <= cg (n) < = f (n).

     Intuitive visual map as follows:

 

 

 

Third, the large notation θ

       Used to define gradual and progressive upper bound lower bound function. When f (n) = θ (g (n)) when representing the g (n) is a progressive f (n) immediately infimum. Progressive descriptor and θ is the strictest in a progressive all descriptors, because it describes an upper bound function and a lower bound functions described.

       Introduction to Algorithms describe how large is θ notation.

       formal mathematical definition of f (n) = θ (cg (n)): the presence of normal number c1, c2, n, n0, when n> n0 and for an arbitrary f (n) that meet c1.g (n) <= f (n) <= c2.g (n), c1.g (n), c2.g (n) is asymptotically normal function (when n tends to infinity, f (n) is positive).  

        Intuitive visual map as follows:              

 

 Important properties: if and only if the function f (n) = time O (g (n)) and f (n) = Ω (g (n)), f (n) = θ (g (n))

 

4: Title

Each row in the table on the left side under analysis function F (n-) and each column of the function G (n-) asymptotic relationship between efficiency, based on the relationship belongs to F (n-) ÎO (g (n)) , f (n) ÎΩ ( G (n-)) , F (n-) ÎΘ (G (n-)) which is one of the three, to fill in the space below the appropriate symbol O , or [Omega] Θ. If f (the n-) and G (the n-) there is more than one suitable progressive relationship between efficiency, fill in only the most rigorous kind of relationship. The first row has been given as exemplary. (No calculation process is given, each blank 1 min)

 

 

 

g(n)

 

n

N 2

2 N

f(n)

N 2

Oh

Th

O

 

n log n 4

 

 

 

 

(1.1)n-10

 

 

 

 

(n-2)!

 

 

 

 

5n + 7n -1

 

 

 

 

 

answer:

 

g(n)

 

n

N 2

2 N

f(n)

N 2

Oh

Th

O

 

n log n 4

Oh

O

O

 

(1.1)n-10

Th

O

O

 

(n-2)!

Oh

Oh

Oh

 

5n + 7n -1

Th

O

O

Guess you like

Origin www.cnblogs.com/dgwblog/p/11985455.html