I. Time Complexity
During algorithm analysis, the total number of statement executions T (n) is a function about the problem scale N. Today, T (n) changes with N and T (n) is determined). The time complexity of the algorithm, that is, the time measurement of the algorithm. t (n) = O (f (n )),
It indicates that the growth rate of Algorithm Execution time is the same as that of F (n) as the increase of the problem scale N. It is called the approximate time complexity of the algorithm, or the time complexity for short. F (n) is a function of problem scale N.
O (1) constant order
O (n) linear order
O (n2) Square level
1. Derivation of the Large O-Order Method
- Replace all addition constants of running time with constant 1
- In the modified number of running functions, only the highest-order items are retained.
- If the highest-order item exists and is not 1, the constant multiplied by this item is removed. The result is a large level of o
Algorithm time complexity and space complexity