lecture 3

1. ADO (Abstract Data Object): do not show specific implementation to the user to provide better flexibility

2. paired with the stack to achieve brackets, check all the brackets are not in pairs

After finding a left parenthesis added stack, find the right parenthesis determine whether the stack is empty, empty directly returns false, it is not to be pop stack is empty until the EOF (end of file)

 

3. gcc to compile

4. In the pseudo-code writing, stack and adds a pop out and push, queue enqueue and dequeue with

5. primitive operations the number of basic operations performed, when the judge sentences, must first determine whether the conditions contained continue implementation of other statements, calculation of the time should count two

6. Program run time

 

7. Time Complexity

If there exist a function f (n), such that when n approaches infinity, T (n) / f (n) is not equal to zero limit constant, called f (n) is T (n) is a function of the same order .

Denoted by T (n) = O (f (n)), said O (f (n)) is a progressive time complexity of the algorithm, the complexity of the abbreviated time (meaning class the teacher can always be customized for the first curve another curve, and then from a certain point so that the first curve is always greater than the first curve, but if there is a curve in the first n ^ 2, n custom curve, in any case increase the coefficient of n, n growth factor ^ 2 are larger. additional examples cited previously run in order to express the long run determines the running time index is larger, as n ^ 2 + n increase quadratic function)

Briefly, i.e. a function of the time T (n) reduced to an order of magnitude, the following rules:

  1. If the running time is constant magnitude, represented by a constant 1;

  2. Retaining only the highest order term function of time;

  3. If the highest order term presence in front of the highest order coefficient is omitted.

 

Guess you like

Origin www.cnblogs.com/eleni/p/11614855.html