Flyfish 2015-7-21
Quote from "Big talk data Structure"
definition of algorithm time complexity
At the time of the algorithm analysis, 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 magnitude of T (N). The time complexity of the algorithm, which is the time measurement of the algorithm, is recorded as: T (n) =o (f (n)). 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 asymptotic time complexity of the algorithm, referred to as the time complexity. where f (n) is a function of the problem size n. This method uses capital O () to represent the algorithm's time complexity notation, 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 N.
derivation of the large O-order:
1. Replace all the addition constants in the run time with constant 1.
2. In the modified run Count function, only the highest order is preserved.
3. If the highest order exists and is not 1, the constant multiplied by the item is removed. The result is the Big O-order.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Time complexity of the algorithm