Custom
In the analysis of the algorithm, the total number of executions of the statement T (N) is a function of the problem size n, which then analyzes the change of T (n) with N and determines the order of the T (N), the time complexity of the algorithm, which is the time measurement of the algorithm, which is recorded as: T (n) =o (f ( It indicates that with the increase of the problem size n, the growth rate of the algorithm execution time is the same as the growth rate of f (n), which is called the progressive time complexity of the algorithm, short of the complexity of time. where f (n) is a function of the problem size n.
-This method uses O () to represent the complexity of the algorithm, which we call the Big O notation.
-In general, the algorithm with the slowest growth of T (n) is the optimal algorithm with the increase of the input size n.
-Obviously, the time complexity of this algorithm shows that the time complexity of our three summation algorithms is O (1), O (n), O (n^2) respectively.
-Derivation of the large O-order method
-Replaces all addition constants in the run time with constant 1. In the modified run Count function, only the highest order is preserved. If the highest order exists and is not one, the constant multiplied by the item is removed. Getting the final result is the Big O-step.
The complexity of algorithm time space