algorithm Definition : A description of the solution steps that solve a particular problem.
algorithm features : poor, deterministic, feasibility, input, output
design requirements for algorithms : correctness, readability, robustness, high efficiency and low storage requirements
algorithm Measurement Method : Post-mortem method (unscientific), pre-analysis and estimation method
The asymptotic growth of the function: given two functions f (n) and g (n), if there is an integer n, so that for all n>n,f (n) is always greater than g (n), then we say that f (n) is growing nearly faster than G (n).
So, can come to the conclusion: Determine an algorithm is not good, you can compare the algorithm's key execution times function of the asymptotic growth, the basic can be analyzed: an algorithm, with the increase of N, it will be better than the other algorithm, or more and more worse than an algorithm.
Steps to derive the large O-order:
Replace all addition constants in run time with constant 1
Only the highest order is kept in the modified run Count function
If the highest order exists and is not 1, the constant multiplied by the item is removed
The result is the Big O-order
With this step, we can get the algorithm to run the number of expressions, and quickly get its time complexity, that is, the large O-order.
It is easy to deduce the large O-order, but the expression of how to get the number of runs is a mathematical foundation.
Common time complexity ordering:
O (1) <o (LOGN) <o (n) <o (NLONGN) <o (n^2) <o (n^3) <o (2^n) <o (n!) <o (N^n)
Algorithm complexity analysis method and algorithm overview