In this lesson, I probably talked about the usage of some symbols. After all, they are matted and have no knowledge about algorithms. I have also referred to other people's notes. The content of this lesson is not too much. It mainly refers to the method for solving the complexity of symbolic representation and recursion. The following two sections will explain it in detail.
I,Progressive symbol
(1) The O symbol, f (n) = O (g (n), indicates that f (n) has a maximum complexity with g (n)Magnitude, That is, less than or equal.
(2) Ω symbol, f (n) = Ω (g (n), f (n) has the least complexity than g (n)Magnitude, That is, greater than or equal.
(3) o symbol, f (n) = o (g (n), indicating that f (n) is more complex than g (n)MagnitudeSmall, that is, less.
(4) ω symbol, f (n) = ω (g (n), indicating that f (n) is more complex than g (n)MagnitudeLarge, that is, greater.
(5) the random symbol (n) = random (g (n), indicating that the complexity of f (n) is greater than or equal to the complexity of g (n, the complexity is less than or equal to g (n), that is, the complexity of g (n) is equivalent.
2. Three methods to solve recursive expressions
Recursion is often used in algorithm design. Recursive methods can clearly display the entire process of the algorithm. To analyze the complexity of the algorithm, recursive expressions are useful.
(1) replacement method.
There are three steps: a) the potential form of Prediction Based on sensory guesses without the relationship coefficient and constant. B) use mathematical induction to verify whether the form obtained in the first step meets the conditions. C) Determine the coefficients and constants. The disadvantage is that it is not strict.
(2) recursive tree.
This method was used in the previous section for merging and sorting.
(3) Main Theorem. (This is only applicable to the recursive formula of the special level, including three cases)
The main theorem usually solves the following recursive expressions: recursion describes the problem of dividing the scale into n into a sub-problem, and the scale of each sub-problem is n/B, here, a and B are normal numbers. The cost of dividing the original problem and Merging Results is described by the function f (n.
Are you tired now? Take a rest and have a cool summer.