(2) k = 01 for (i = 1; i <= n; i ) {2 for (j = i; j <= n; j ) 3 k ;} K execution number is N, N-1 , N-2, .... 1, etc., (n 1) * n / 2 equivalence quotation and formula: SN = (A1 A) * N / 2 ----- -------------------------------------------------- ---------------------------------- An algorithm spending time = execution time of each statement in the algorithm The input quantity of the algorithm solve the problem is called the size of the problem (Size), generally uses an integer to represent a time complexity of an algorithm (Time Complexity, also called time complexity) T (N) is the time spent of the algorithm, it is The function of the problem N n is solved by the algorithm. When the scale N tendency of the problem is infinite, the order of time complexity T (n) is called the progressive time complexity of the algorithm. F (n) is generally the frequency of the frequency in the algorithm. The time performance of an algorithm is evaluated by the order of algorithm time complexity (ie, the progressive time complexity of the algorithm). Common time complexity is in turn in order: constant 0 (1), alternative order 0 (LOG2N), line-shade 0 (N), linear alternative 0 (NLOG2N), Squadron 0 (N2) Cube 0 (N3), ..., K (NK), index step 0 (2N). Obviously, the algorithm efficiency of the exponential order 0 (2N) is extremely low, and it cannot be applied when the n value is slightly large. =, ================================================================================================================================================================ ========== How do I look at this? The frequency is well understood, the statement is executed. This time is quarry, my look is very depressed. ? ? ? ? ? ? ? ? ? ? ? ? ? ? depressed. =================================================================================================================================================================================